Package com.batch.android.module
Class UserModule
- java.lang.Object
-
- com.batch.android.module.BatchModule
-
- com.batch.android.module.UserModule
-
public final class UserModule extends BatchModule
Batch User module
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUserModule.SaveException
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAMETER_KEY_AMOUNTstatic java.lang.StringPARAMETER_KEY_DATAstatic java.lang.StringPARAMETER_KEY_LABELstatic java.lang.StringTAG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean_trackEvent(java.lang.String name, JSONObject params)static voidaddUserPendingOperations(java.util.List<UserOperation> operations)Add pending operations whenBatchUserDataEditor.save()is called before the SDK is startedstatic voidapplyUserOperationsSync(java.util.List<UserOperation> pendingOperationQueue)voidbatchDidStart()Called by Batch right after batch start
NB : Same context and activity that in willStart but with the new stateState.READYsetvoidbumpVersion(long serverVersion)java.lang.StringgetId()ID of the moduleintgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated)static voidprintDebugInfo()static UserModuleprovide()voidstartCheckWS(long msDelay)voidstartSendWS(long msDelay)voidstoreTransactionID(java.lang.String transactionID, long version)static voidsubmitOnApplyQueue(long msDelay, java.lang.Runnable r)voidtrackLocation(android.location.Location location)voidtrackPublicEvent(java.lang.String event, java.lang.String label, JSONObject data)Track a public eventvoidtrackTransaction(double amount, JSONObject data)static voiduserOptedIn(android.content.Context context)static voidwipeData(android.content.Context context)-
Methods inherited from class com.batch.android.module.BatchModule
batchContextBecameAvailable, batchDidStop, batchIsFinishing, batchWillStart, batchWillStop
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
PARAMETER_KEY_LABEL
public static final java.lang.String PARAMETER_KEY_LABEL
- See Also:
- Constant Field Values
-
PARAMETER_KEY_DATA
public static final java.lang.String PARAMETER_KEY_DATA
- See Also:
- Constant Field Values
-
PARAMETER_KEY_AMOUNT
public static final java.lang.String PARAMETER_KEY_AMOUNT
- See Also:
- Constant Field Values
-
-
Method Detail
-
provide
public static UserModule provide()
-
getId
public java.lang.String getId()
Description copied from class:BatchModuleID of the module- Specified by:
getIdin classBatchModule- Returns:
-
getState
public int getState()
Description copied from class:BatchModuleShould return the state of the module (usually 0 for deactivated, 1 for activated)- Specified by:
getStatein classBatchModule- Returns:
-
batchDidStart
public void batchDidStart()
Description copied from class:BatchModuleCalled by Batch right after batch start
NB : Same context and activity that in willStart but with the new stateState.READYset- Overrides:
batchDidStartin classBatchModule
-
startSendWS
public void startSendWS(long msDelay)
-
startCheckWS
public void startCheckWS(long msDelay)
-
storeTransactionID
public void storeTransactionID(java.lang.String transactionID, long version)
-
bumpVersion
public void bumpVersion(long serverVersion)
-
trackPublicEvent
public void trackPublicEvent(java.lang.String event, java.lang.String label, JSONObject data)Track a public event- Parameters:
event- Event namelabel- Event labeldata- Event data, expected to already be converted from BatchEventData.
-
_trackEvent
protected boolean _trackEvent(java.lang.String name, JSONObject params)
-
trackLocation
public void trackLocation(android.location.Location location)
-
trackTransaction
public void trackTransaction(double amount, JSONObject data)
-
submitOnApplyQueue
public static void submitOnApplyQueue(long msDelay, java.lang.Runnable r)
-
addUserPendingOperations
public static void addUserPendingOperations(java.util.List<UserOperation> operations)
Add pending operations whenBatchUserDataEditor.save()is called before the SDK is started- Parameters:
operations-
-
applyUserOperationsSync
public static void applyUserOperationsSync(java.util.List<UserOperation> pendingOperationQueue) throws UserModule.SaveException
- Throws:
UserModule.SaveException
-
printDebugInfo
public static void printDebugInfo()
-
wipeData
public static void wipeData(android.content.Context context)
-
userOptedIn
public static void userOptedIn(android.content.Context context)
-
-