Class LocalCampaignsModule


  • public class LocalCampaignsModule
    extends BatchModule
    Batch's Local Campaigns Messaging Module.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TAG  
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from class: BatchModule
        ID of the module
        Specified by:
        getId in class BatchModule
        Returns:
      • getState

        public int getState()
        Description copied from class: BatchModule
        Should return the state of the module (usually 0 for deactivated, 1 for activated)
        Specified by:
        getState in class BatchModule
        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: BatchModule
        Called 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:
        batchContextBecameAvailable in class BatchModule
      • batchDidStop

        public void batchDidStop()
        Description copied from class: BatchModule
        Called by Batch right after batch stop
        NB : No context or activity are available
        Overrides:
        batchDidStop in class BatchModule