Package com.batch.android.module
Class DisplayReceiptModule
- java.lang.Object
-
- com.batch.android.module.BatchModule
-
- com.batch.android.module.DisplayReceiptModule
-
public class DisplayReceiptModule extends BatchModule
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbatchDidStart()Called by Batch right after batch start
NB : Same context and activity that in willStart but with the new stateState.READYsetjava.lang.StringgetId()ID of the moduleintgetState()Should return the state of the module (usually 0 for deactivated, 1 for activated)static DisplayReceiptModuleprovide()voidscheduleDisplayReceipt(android.content.Context context, InternalPushData pushData)Save the new receipt and schedule the send of display receipts using a JobService If no delay or Android version is too low, we send without a jobstatic voidsendReceipt(android.content.Context context, boolean replay)Send up toCacheHelper.MAX_READ_RECEIPT_FROM_CACHEdisplay receipt to the ws.voidwipeData(android.content.Context context)Delete all receipt still in cache-
Methods inherited from class com.batch.android.module.BatchModule
batchDidStop, batchIsFinishing, batchWillStart, batchWillStop
-
-
-
-
Method Detail
-
provide
public static DisplayReceiptModule 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
-
scheduleDisplayReceipt
public void scheduleDisplayReceipt(android.content.Context context, @NonNull InternalPushData pushData)Save the new receipt and schedule the send of display receipts using a JobService If no delay or Android version is too low, we send without a job
-
sendReceipt
public static void sendReceipt(android.content.Context context, boolean replay)Send up toCacheHelper.MAX_READ_RECEIPT_FROM_CACHEdisplay receipt to the ws.Update send attempts and replay in cached files. Delete cached file if send is successful.
- Parameters:
context- app contextreplay- replay = true if request is at SDK start false otherwise
-
wipeData
public void wipeData(@NonNull android.content.Context context)Delete all receipt still in cache- Parameters:
context-
-
-