public class ModuleDeviceIdCore extends ModuleBase
| Constructor and Description |
|---|
ModuleDeviceIdCore() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.concurrent.Future<ConfigCore.DID> |
acquireId(CtxCore ctx,
ConfigCore.DID holder,
boolean fallbackAllowed,
Tasks.Callback<ConfigCore.DID> callback) |
protected ConfigCore.DID |
acquireIdSync(CtxCore ctx,
ConfigCore.DID holder,
boolean fallbackAllowed)
Synchronously gets id of the strategy supplied.
|
protected void |
callOnDeviceId(CtxCore ctx,
ConfigCore.DID id,
ConfigCore.DID old) |
void |
changeDeviceId(CtxCore ctx,
java.lang.String id,
boolean withMerge)
Resetting id without merging profiles on server:
End current session if any
Begin new session with new id if previously ended a session
|
java.lang.Integer |
getFeature() |
void |
init(InternalConfig config)
All initialization must be done in this method, not constructor.
|
void |
login(CtxCore ctx,
java.lang.String id)
Logging into app-specific account:
- reset device id and notify modules;
- send corresponding request to server.
|
void |
logout(CtxCore ctx)
Logging out from app-specific account and reverting back to previously used id if any:
- nullify device id and notify modules;
- send corresponding request to server.
|
void |
onContextAcquired(CtxCore ctx)
Regular logic of acquiring id of specified strategy and migration from legacy SDK.
|
void |
onDeviceId(CtxCore ctx,
ConfigCore.DID deviceId,
ConfigCore.DID oldDeviceId)
Device ID has been acquired from device id provider.
|
static void |
registerGenerator(int index,
DeviceIdGenerator generator) |
void |
stop(CtxCore ctx,
boolean clear)
App user decided to opt out from analytics or developer changed important preferences.
|
isActive, onActivityCreated, onActivityDestroyed, onActivityPaused, onActivityResumed, onActivitySaveInstanceState, onActivityStarted, onActivityStopped, onConfigurationChanged, onLimitedContextAcquired, onRequest, onRequestCompleted, onSessionBegan, onSessionEnded, onUserChangedpublic static void registerGenerator(int index,
DeviceIdGenerator generator)
public void init(InternalConfig config) throws java.lang.IllegalArgumentException
Moduleinit in interface Moduleinit in class ModuleBaseconfig - Countly configuration object: can be stored locally if needed.java.lang.IllegalArgumentException - in case supplied InternalConfig is not consistent.public void onContextAcquired(CtxCore ctx)
onContextAcquired in interface ModuleonContextAcquired in class ModuleBasectx - Ctxpublic void onDeviceId(CtxCore ctx, ConfigCore.DID deviceId, ConfigCore.DID oldDeviceId)
ModuleonDeviceId in interface ModuleonDeviceId in class ModuleBasectx - Ctx to run indeviceId - deviceId valid from now onoldDeviceId - deviceId valid previously if anypublic java.lang.Integer getFeature()
public void login(CtxCore ctx, java.lang.String id)
ctx - ctx to run inid - device id to change topublic void logout(CtxCore ctx)
ctx - context to run inpublic void changeDeviceId(CtxCore ctx, java.lang.String id, boolean withMerge)
ctx - context to run inid - new user idprotected java.util.concurrent.Future<ConfigCore.DID> acquireId(CtxCore ctx, ConfigCore.DID holder, boolean fallbackAllowed, Tasks.Callback<ConfigCore.DID> callback)
protected ConfigCore.DID acquireIdSync(CtxCore ctx, ConfigCore.DID holder, boolean fallbackAllowed)
ctx - Ctx to run inholder - DID object which holds strategy and possibly other info for id generationfallbackAllowed - whether to automatically fallback to any available alternative or notConfigCore.DID instance with an idprotected void callOnDeviceId(CtxCore ctx, ConfigCore.DID id, ConfigCore.DID old)
public void stop(CtxCore ctx, boolean clear)
ModuleStorable files if clear is truestop in interface Modulestop in class ModuleBasectx - CtxCore to run inclear - true if module must clear it's data files, false otherwise