public class NotificationClient
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NotificationClient.CampaignPushResult
Deprecated.
|
static class |
NotificationClient.PushResult
Result values of handling a Pinpoint push message.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADM_INTENT_ACTION
Intent action for ADM
|
static java.lang.String |
BAIDU_INTENT_ACTION
Intent action for Baidu
|
static java.lang.String |
FCM_INTENT_ACTION
Intent action for FCM
|
static java.lang.String |
GCM_INTENT_ACTION
Intent action for GCM
|
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)
Deprecated.
Use
createClient(PinpointContext, ChannelType) instead. |
Modifier and Type | Method and Description |
---|---|
void |
addDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler handler)
Add a device token register handler.
|
void |
addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
Deprecated.
|
boolean |
areAppNotificationsEnabled()
If app-level opt-out is enabled, this method always returns false.
|
static NotificationClient |
createClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext,
ChannelType channelType)
Creates a new NotificationClient based on the supplied context and channel type.
|
java.lang.String |
getChannelType()
The Pinpoint channel type for the device associated with
this notification client.
|
java.lang.String |
getDeviceToken()
get the device token.
|
java.lang.String |
getGCMDeviceToken()
Deprecated.
Use
getDeviceToken() instead. |
NotificationClient.CampaignPushResult |
handleCampaignPush(NotificationDetails notificationDetails)
Deprecated.
|
NotificationClient.CampaignPushResult |
handleFCMCampaignPush(java.lang.String from,
java.util.Map<java.lang.String,java.lang.String> data)
Deprecated.
Use
handleCampaignPush(NotificationDetails) instead. |
NotificationClient.CampaignPushResult |
handleGCMCampaignPush(java.lang.String from,
android.os.Bundle data,
java.lang.Class<? extends android.app.Service> serviceClass)
Deprecated.
Use
handleCampaignPush(NotificationDetails) instead. |
NotificationClient.PushResult |
handleNotificationReceived(NotificationDetails notificationDetails)
Handles Pinpoint 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 |
registerDeviceToken(java.lang.String deviceToken)
This method should be called once the device token has been received from
the device's messaging api in order to enable being targeted for campaign push
notifications.
|
void |
registerDeviceToken(java.lang.String userId,
java.lang.String channelId)
This method should be called once the user id and channel id has been received from
the device's messaging api in order to enable being targeted for campaign push
notifications.
|
void |
registerGCMDeviceToken(java.lang.String deviceToken)
Deprecated.
Use
registerDeviceToken(String) instead. |
void |
removeDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler handler)
Remove the device register handler.
|
void |
removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
Deprecated.
|
public static final java.lang.String INTENT_SNS_NOTIFICATION_FROM
public static final java.lang.String INTENT_SNS_NOTIFICATION_DATA
public static final java.lang.String ADM_INTENT_ACTION
public static final java.lang.String BAIDU_INTENT_ACTION
public static final java.lang.String GCM_INTENT_ACTION
public static final java.lang.String FCM_INTENT_ACTION
@Deprecated public NotificationClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext)
createClient(PinpointContext, ChannelType)
instead.pinpointContext
- the Pinpoint context. PinpointContext
public static NotificationClient createClient(com.amazonaws.mobileconnectors.pinpoint.internal.core.PinpointContext pinpointContext, ChannelType channelType)
pinpointContext
- Context to associate with the client.channelType
- The channel type the client will support.NotificationClient
@Deprecated public void addGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
addDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler)
instead.handler
- the GCM register handler.@Deprecated public void removeGCMTokenRegisteredHandler(GCMTokenRegisteredHandler handler)
removeDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler)
instead.handler
- the gcm register handler.@Deprecated public void registerGCMDeviceToken(java.lang.String deviceToken)
registerDeviceToken(String)
instead.deviceToken
- the GCM device token.@Deprecated public java.lang.String getGCMDeviceToken()
getDeviceToken()
instead.@Deprecated public NotificationClient.CampaignPushResult handleFCMCampaignPush(java.lang.String from, java.util.Map<java.lang.String,java.lang.String> data)
handleCampaignPush(NotificationDetails)
instead.from
- the from string received by the FCM service,data
- the bundle received from the FCM serviceNotificationClient.PushResult
.@Deprecated public NotificationClient.CampaignPushResult handleGCMCampaignPush(java.lang.String from, android.os.Bundle data, java.lang.Class<? extends android.app.Service> serviceClass)
handleCampaignPush(NotificationDetails)
instead.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.PushResult
.public boolean areAppNotificationsEnabled()
public final void addDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler handler)
handler
- the devices register handler.public final void removeDeviceTokenRegisteredHandler(DeviceTokenRegisteredHandler handler)
handler
- the gcm register handler.public final void registerDeviceToken(java.lang.String deviceToken)
deviceToken
- the device token.public final void registerDeviceToken(java.lang.String userId, java.lang.String channelId)
userId
- the user idchannelId
- the channel idpublic final java.lang.String getDeviceToken()
public java.lang.String getChannelType()
public NotificationClient.PushResult handleNotificationReceived(NotificationDetails notificationDetails)
notificationDetails
- the notification message received by the device's messaging serviceNotificationClient.PushResult
.@Deprecated public NotificationClient.CampaignPushResult handleCampaignPush(NotificationDetails notificationDetails)
handleNotificationReceived(NotificationDetails)
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.