public class NotificationClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NotificationClient.CampaignPushResult
Result values of handling a pinpoint push message.
|
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CAMPAIGN_ACTIVITY_ID_ATTRIBUTE_KEY |
protected static String |
CAMPAIGN_ACTIVITY_ID_PUSH_KEY |
protected static String |
CAMPAIGN_ID_ATTRIBUTE_KEY |
protected static String |
CAMPAIGN_ID_PUSH_KEY |
protected static String |
CAMPAIGN_PUSH_KEY_PREFIX |
protected static String |
CAMPAIGN_TREATMENT_ID_ATTRIBUTE_KEY |
protected static String |
CAMPAIGN_TREATMENT_ID_PUSH_KEY |
static String |
INTENT_SNS_NOTIFICATION_DATA
Intent Key for GCM bundle data.
|
static String |
INTENT_SNS_NOTIFICATION_FROM
Intent Key for GCM bundle.
|
protected static String |
PINPOINT_PUSH_KEY_PREFIX |
| Constructor and Description |
|---|
NotificationClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
Add a GCM token register handler.
|
boolean |
areAppNotificationsEnabled()
On devices using Android API level 19 and above this method properly
returns whether local notifications are enabled for the app.
|
String |
getGCMDeviceToken()
get the GCM device token.
|
NotificationClient.CampaignPushResult |
handleFCMCampaignPush(String from,
Map<String,String> data)
Handles pinpoint FCM push messages by posting a local notification when
the app is in the background, or sending a local broadcast if the app is
in the foreground.
|
NotificationClient.CampaignPushResult |
handleGCMCampaignPush(String from,
android.os.Bundle data,
Class<? extends android.app.Service> serviceClass)
Handles pinpoint GCM push messages by posting a local notification when
the app is in the background, or sending a local broadcast if the app is
in the foreground.
|
void |
registerGCMDeviceToken(String deviceToken)
This method should be called once the device token has been received from
the GCM api in order to enable being targeted for campaign push
notifications.
|
void |
removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
Remove the gcm register handler.
|
public static final String INTENT_SNS_NOTIFICATION_FROM
public static final String INTENT_SNS_NOTIFICATION_DATA
protected static final String PINPOINT_PUSH_KEY_PREFIX
protected static final String CAMPAIGN_PUSH_KEY_PREFIX
protected static final String CAMPAIGN_ID_ATTRIBUTE_KEY
protected static final String CAMPAIGN_ID_PUSH_KEY
protected static final String CAMPAIGN_ACTIVITY_ID_ATTRIBUTE_KEY
protected static final String CAMPAIGN_ACTIVITY_ID_PUSH_KEY
protected static final String CAMPAIGN_TREATMENT_ID_ATTRIBUTE_KEY
protected static final String CAMPAIGN_TREATMENT_ID_PUSH_KEY
public NotificationClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
pinpointContext - the pinpoint context. PinpointContextpublic void addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
handler - the GCM register handler.public void removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
handler - the gcm register handler.public void registerGCMDeviceToken(String deviceToken)
deviceToken - the GCM device token.public String getGCMDeviceToken()
public NotificationClient.CampaignPushResult handleFCMCampaignPush(String from, Map<String,String> data)
from - the from string received by the FCM service,data - the bundle received from the FCM serviceNotificationClient.CampaignPushResult.public NotificationClient.CampaignPushResult handleGCMCampaignPush(String from, android.os.Bundle data, Class<? extends android.app.Service> serviceClass)
from - the from string received by the GCM servicedata - the bundle received from the GCM serviceserviceClass - the class extending GCMListenerService that handles
receiving GCM messages.NotificationClient.CampaignPushResult.public boolean areAppNotificationsEnabled()
Copyright © 2017. All rights reserved.