Package com.batch.android.module
Class LocalCampaignsModule
- java.lang.Object
-
- com.batch.android.module.BatchModule
-
- com.batch.android.module.LocalCampaignsModule
-
public class LocalCampaignsModule extends BatchModule
Batch's Local Campaigns Messaging Module.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTAG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbatchContextBecameAvailable(android.content.Context applicationContext)Called by Batch as soon as a context is available in the runtimeManager For convenience, the application context is available as a parameter.voidbatchDidStop()Called by Batch right after batch stop
NB : No context or activity are availablejava.lang.StringgetId()ID of the moduleintgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated)voidonLocalCampaignsWebserviceFinished()Release the signal queue when the local campaigns webservice is finishedstatic LocalCampaignsModuleprovide()voidregisterBroadcastReceiverIfNeeded(android.content.Context context)Register the broadcast receiver for "new_session" intent if needed.voidsendSignal(Signal signal)Start sending a signal If another one is already processing, signal is added to queue.voidwipeData(android.content.Context context)Delete all campaigns from the manager-
Methods inherited from class com.batch.android.module.BatchModule
batchDidStart, batchIsFinishing, batchWillStart, batchWillStop
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
provide
public static LocalCampaignsModule 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:
-
sendSignal
public void sendSignal(@NonNull Signal signal)Start sending a signal If another one is already processing, signal is added to queue.- Parameters:
signal- signal to send
-
onLocalCampaignsWebserviceFinished
public void onLocalCampaignsWebserviceFinished()
Release the signal queue when the local campaigns webservice is finished
-
wipeData
public void wipeData(@NonNull android.content.Context context)Delete all campaigns from the manager- Parameters:
context- context
-
registerBroadcastReceiverIfNeeded
public void registerBroadcastReceiverIfNeeded(@NonNull android.content.Context context)Register the broadcast receiver for "new_session" intent if needed.- Parameters:
context- used to instantiate the LocalBroadcastManager singleton if its not.
-
batchContextBecameAvailable
public void batchContextBecameAvailable(@NonNull android.content.Context applicationContext)Description copied from class:BatchModuleCalled by Batch as soon as a context is available in the runtimeManager For convenience, the application context is available as a parameter. LocalBroadcastManager is also up.- Overrides:
batchContextBecameAvailablein classBatchModule
-
batchDidStop
public void batchDidStop()
Description copied from class:BatchModuleCalled by Batch right after batch stop
NB : No context or activity are available- Overrides:
batchDidStopin classBatchModule
-
-