public class NotificationClient
extends java.lang.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 |
---|---|
static java.lang.String |
INTENT_SNS_NOTIFICATION_DATA
Intent Key for GCM bundle data.
|
static java.lang.String |
INTENT_SNS_NOTIFICATION_FROM
Intent Key for GCM bundle.
|
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.
|
java.lang.String |
getGCMDeviceToken()
get the GCM device token.
|
NotificationClient.CampaignPushResult |
handleFCMCampaignPush(java.lang.String from,
java.util.Map<java.lang.String,java.lang.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(java.lang.String from,
android.os.Bundle data,
java.lang.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(java.lang.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 java.lang.String INTENT_SNS_NOTIFICATION_FROM
public static final java.lang.String INTENT_SNS_NOTIFICATION_DATA
public NotificationClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
pinpointContext
- the pinpoint context. PinpointContext
public void addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
handler
- the GCM register handler.public void removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
handler
- the gcm register handler.public void registerGCMDeviceToken(java.lang.String deviceToken)
deviceToken
- the GCM device token.public java.lang.String getGCMDeviceToken()
public NotificationClient.CampaignPushResult handleFCMCampaignPush(java.lang.String from, java.util.Map<java.lang.String,java.lang.String> data)
from
- the from string received by the FCM service,data
- the bundle received from the FCM serviceNotificationClient.CampaignPushResult
.public NotificationClient.CampaignPushResult handleGCMCampaignPush(java.lang.String from, android.os.Bundle data, java.lang.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 © 2010 Amazon Web Services, Inc. All Rights Reserved.