public class NetmeraPushBroadcastReceiver
extends android.content.BroadcastReceiver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_CAROUSEL_PUSH_ITEM
The action of the Intent when a carousel notification action thump item has been clicked.
|
static java.lang.String |
ACTION_CAROUSEL_PUSH_NEXT
The action of the Intent when a carousel notification action right button has been clicked.
|
static java.lang.String |
ACTION_CAROUSEL_PUSH_OPEN
The action of the Intent when a carousel notification action item has been clicked.
|
static java.lang.String |
ACTION_CAROUSEL_PUSH_PREV
The action of the Intent when a carousel notification action left button has been clicked.
|
static java.lang.String |
ACTION_PUSH_BUTTON_CLICKED
The action of the Intent when a notification action button has been clicked.
|
static java.lang.String |
ACTION_PUSH_DISMISS
The action of the Intent when a notification has been dismissed.
|
static java.lang.String |
ACTION_PUSH_OPEN
The action of the Intent when a notification has been opened.
|
static java.lang.String |
ACTION_PUSH_RECEIVE
The action of the Intent when a push has been received.
|
static java.lang.String |
ACTION_PUSH_REGISTER
The action of the Intent when registration has been completed .
|
Constructor and Description |
---|
NetmeraPushBroadcastReceiver() |
Modifier and Type | Method and Description |
---|---|
void |
onPushButtonClicked(android.content.Context context,
android.os.Bundle bundle,
NetmeraPushObject netmeraPushObject)
Called when any of notification button is clicked.
|
void |
onPushDismiss(android.content.Context context,
android.os.Bundle bundle,
NetmeraPushObject netmeraPushObject)
Called when the push notification is dismissed by the user.
|
void |
onPushOpen(android.content.Context context,
android.os.Bundle bundle,
NetmeraPushObject netmeraPushObject)
Called when the push notification is opened by the user.
|
void |
onPushReceive(android.content.Context context,
android.os.Bundle bundle,
NetmeraPushObject netmeraPushObject)
Called when a push message is received.
|
void |
onPushRegister(android.content.Context context,
java.lang.String gcmSenderId,
java.lang.String pushToken)
Called when push registration is completed.
|
void |
onReceive(android.content.Context context,
android.content.Intent intent)
Delegates the generic
onReceive event to a notification lifecycle event. |
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
public static final java.lang.String ACTION_PUSH_REGISTER
public static final java.lang.String ACTION_PUSH_RECEIVE
public static final java.lang.String ACTION_PUSH_OPEN
public static final java.lang.String ACTION_PUSH_DISMISS
public static final java.lang.String ACTION_PUSH_BUTTON_CLICKED
public static final java.lang.String ACTION_CAROUSEL_PUSH_OPEN
public static final java.lang.String ACTION_CAROUSEL_PUSH_PREV
public static final java.lang.String ACTION_CAROUSEL_PUSH_NEXT
public static final java.lang.String ACTION_CAROUSEL_PUSH_ITEM
public void onReceive(android.content.Context context, android.content.Intent intent)
onReceive
event to a notification lifecycle event.
Subclasses are advised to override the lifecycle events and not this method.onReceive
in class android.content.BroadcastReceiver
context
- The Context
in which the receiver is running.intent
- An Intent
containing the data of the current push notification.onPushRegister(Context, String, String)
,
onPushReceive(Context, Bundle, NetmeraPushObject)
,
onPushOpen(Context, Bundle, NetmeraPushObject)
,
onPushDismiss(Context, Bundle, NetmeraPushObject)
,
onPushButtonClicked(Context, Bundle, NetmeraPushObject)
public void onPushRegister(android.content.Context context, java.lang.String gcmSenderId, java.lang.String pushToken)
context
- The Context
in which the receiver is running.gcmSenderId
- A String
for which pushToken has been retrieved.pushToken
- A String
uniquely identifying the device for sending push messages.public void onPushReceive(android.content.Context context, android.os.Bundle bundle, @Nullable NetmeraPushObject netmeraPushObject)
NetmeraPushObject
will be non-null and a notification will be shown by default. However, if message doesn't come
from Netmera, NetmeraPushObject
will be null to indicate it is not a Netmera message and
data of received message will be served via bundle parameter.context
- The Context
in which the receiver is running.bundle
- A Bundle
containing the data of the current push message.netmeraPushObject
- An NetmeraPushObject
containing structured data of the current push message
if it has come from Netmera, null otherwise.public void onPushOpen(android.content.Context context, android.os.Bundle bundle, NetmeraPushObject netmeraPushObject)
context
- The Context
in which the receiver is running.bundle
- A Bundle
containing the data of the current push message.netmeraPushObject
- An NetmeraPushObject
containing structured data of the opened push message.public void onPushDismiss(android.content.Context context, android.os.Bundle bundle, NetmeraPushObject netmeraPushObject)
context
- The Context
in which the receiver is running.bundle
- A Bundle
containing the data of the current push message.netmeraPushObject
- An NetmeraPushObject
containing structured data of the dismissed push messagepublic void onPushButtonClicked(android.content.Context context, android.os.Bundle bundle, NetmeraPushObject netmeraPushObject)
context
- The Context
in which the receiver is running.bundle
- A Bundle
containing the data of the current push message.netmeraPushObject
- A NetmeraPushObject
containing structured data of the current push message
of which action button is clicked.