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 |
String |
INTENT_SNS_NOTIFICATION_DATA
Intent Key for GCM bundle data.
|
String |
INTENT_SNS_NOTIFICATION_FROM
Intent Key for GCM bundle.
|
| Constructor and Description |
|---|
NotificationClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler 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() |
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) |
public String INTENT_SNS_NOTIFICATION_FROM
public String INTENT_SNS_NOTIFICATION_DATA
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)
public void addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
public void removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler 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 © 2016. All rights reserved.