Package com.batch.android
Class BatchPushMessageReceiver
java.lang.Object
android.content.BroadcastReceiver
com.batch.android.BatchPushMessageReceiver
Batch's implementation of FCM's Push BroadcastReceiver
-
Nested Class Summary
Nested classes/interfaces inherited from class android.content.BroadcastReceiver
BroadcastReceiver.PendingResult
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
completeWakefulIntent
(Intent intent) Finish the execution from a previousstartWakefulService(android.content.Context, android.content.Intent)
.void
protected boolean
presentNotification
(Context context, Intent intent) static ComponentName
startWakefulService
(Context context, Intent intent) Do aContext.startService
, but holding a wake lock while the service starts.Methods inherited from class android.content.BroadcastReceiver
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, getSentFromPackage, getSentFromUid, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
-
Constructor Details
-
BatchPushMessageReceiver
public BatchPushMessageReceiver()
-
-
Method Details
-
onReceive
- Specified by:
onReceive
in classBroadcastReceiver
-
presentNotification
-
startWakefulService
Do aContext.startService
, but holding a wake lock while the service starts. This will modify the Intent to hold an extra identifying the wake lock; when the service receives it inService.onStartCommand
, it should pass back the Intent it receives there tocompleteWakefulIntent(android.content.Intent)
in order to release the wake lock.- Parameters:
context
- The Context in which it operate.intent
- The Intent with which to start the service, as perContext.startService
.
-
completeWakefulIntent
Finish the execution from a previousstartWakefulService(android.content.Context, android.content.Intent)
. Any wake lock that was being held will now be released.- Parameters:
intent
- The Intent as originally generated bystartWakefulService(android.content.Context, android.content.Intent)
.- Returns:
- Returns true if the intent is associated with a wake lock that is now released; returns false if there was no wake lock specified for it.
-