Handling Amazon Device Messaging Push Notifications
Amazon Device Messaging (ADM) is a service used to send push notifications to apps running on Amazon devices, such as Kindle Fire tablets. By integrating ADM with your app, you can use Amazon Pinpoint to send notifications to your app through the ADM mobile push channel.
To send push notifications to your app using Amazon Pinpoint and ADM, you need the following:
Amazon Developer account.
Client ID and client secret from Amazon Device Messaging.
ADM registration ID (provided by the end device that contains the ADM platform).
Integrating ADM with Your App
If you are already familiar with ADM and have ADM credentials, you can follow the steps for Integrating Your App with Amazon Device Messaging in the Amazon Developer documentation. Otherwise, for an introduction to ADM, see Understanding Amazon Device Messaging.
To integrate with Amazon Pinpoint, your subclass implementation of
com.amazon.device.messaging.ADMMessageHandlerBase should include the following methods and perform the corresponding calls:
Called when the device is registered with the ADM service. Provides the ADM registration ID that is needed to register the device with Amazon Pinpoint. Include the following call as part of this method:
Called when the device is no longer registered with the ADM service.
Called when the device receives a message notification from ADM. Include the following as part of this method:
NotificaitonDetails details = NotificationDetailsBuilder.builder() .intent(intent); .intentAction(NotificationClient.ADM_INTENT_ACTION) .build(); pinpointManager.getNotificationClient().handleCampaignPush(details)
Testing ADM Push Notifications
To test, you need an Amazon Pinpoint project, an ADM client ID, and an ADM client secret.
Before you begin, augment your app to display the device token after registration. The device token can be retrieved by calling:
Complete the following steps using the Amplify CLI and Amazon Pinpoint console to test ADM push notifications
Register ADM as a channel with your Amazon Pinpoint project. Provide the ADM client ID and the ADM client secret.
Run the following command to navigate to the Amazon Pinpoint console.
$ amplify console analytics
- On the left pane, select
Show more push notification servicesand click
Amazon Device Messaging.
- Enter the
Client IDand the
Client Secretand click
Saveat the right bottom of the page.
ADM is registered as a push notification service.
Install your app on a device that has ADM enabled, and capture the generated device token.
Send a direct message to the device specifying the device token as the address.
- On the Amazon Pinpoint console, go to
Push notificationsas the channel.
- Enter the endpoint ID or the device token in the
ADMas the push notifications service.
- Create a message and click
Send messageat the bottom right corner of the page to send a direct message.