-
public class LocalCampaignsModule extends BatchModule
Batch's Local Campaigns Messaging Module.
-
-
Method Summary
Modifier and Type Method Description static LocalCampaignsModuleprovide()StringgetId()ID of the module intgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated) voidsendSignal(@NonNull() Signal signal)Start sending a signalIf another one is already processing, signal is added to queue. voidonLocalCampaignsWebserviceFinished()Release the signal queue when the local campaigns webservice is finished voidwipeData(@NonNull() Context context)Delete all campaigns from the manager voidregisterBroadcastReceiverIfNeeded(@NonNull() Context context)Register the broadcast receiver for "new_session" intent if needed. voidbatchContextBecameAvailable(@NonNull() Context applicationContext)Called by Batch as soon as a context is available in the runtimeManagerFor convenience, the application context is available as a parameter.LocalBroadcastManager is also up. voidbatchDidStop()Called by Batch right after batch stopNB : No context or activity are available -
-
Method Detail
-
provide
static LocalCampaignsModule provide()
-
getState
int getState()
Should return the state of the module (usually 0 for deactivated, 1 for activated)
-
sendSignal
void sendSignal(@NonNull() Signal signal)
Start sending a signalIf another one is already processing, signal is added to queue.
- Parameters:
signal- signal to send
-
onLocalCampaignsWebserviceFinished
void onLocalCampaignsWebserviceFinished()
Release the signal queue when the local campaigns webservice is finished
-
wipeData
void wipeData(@NonNull() Context context)
Delete all campaigns from the manager
- Parameters:
context- context
-
registerBroadcastReceiverIfNeeded
void registerBroadcastReceiverIfNeeded(@NonNull() Context context)
Register the broadcast receiver for "new_session" intent if needed.
- Parameters:
context- used to instantiate the LocalBroadcastManager singleton if its not.
-
batchContextBecameAvailable
void batchContextBecameAvailable(@NonNull() Context applicationContext)
Called by Batch as soon as a context is available in the runtimeManagerFor convenience, the application context is available as a parameter.LocalBroadcastManager is also up.
-
batchDidStop
void batchDidStop()
Called by Batch right after batch stopNB : No context or activity are available
-
-
-
-