Sending mobile push notifications with Amazon SNS
You can use Amazon SNS to send push notification messages directly to apps on mobile devices. Push notification messages sent to a mobile endpoint can appear in the mobile app as message alerts, badge updates, or sound alerts.
Topics
- How Amazon SNS user notifications work
- Setting up push notifications with Amazon SNS
- Setting up a mobile app in Amazon SNS
- Using Amazon SNS for mobile push notifications
- Amazon SNS mobile app attributes
- Amazon SNS application event notifications for mobile applications
- Mobile push API actions
- Common Amazon SNS mobile push API errors
- Using the Amazon SNS time to live message attribute for mobile push notifications
- Amazon SNS mobile application supported Regions
- Best practices for managing Amazon SNS mobile push notifications
How Amazon SNS user notifications work
You send push notification messages to both mobile devices and desktops using one of the following supported push notification services:
-
Amazon Device Messaging (ADM)
-
Apple Push Notification Service (APNs) for both iOS and Mac OS X
-
Baidu Cloud Push (Baidu)
-
Firebase Cloud Messaging (FCM)
-
Microsoft Push Notification Service for Windows Phone (MPNS)
-
Windows Push Notification Services (WNS)
Push notification services, such as APNs and FCM, maintain a connection with each app and associated mobile device registered to use their service. When an app and mobile device register, the push notification service returns a device token. Amazon SNS uses the device token to create a mobile endpoint, to which it can send direct push notification messages. In order for Amazon SNS to communicate with the different push notification services, you submit your push notification service credentials to Amazon SNS to be used on your behalf. For more information, see Setting up push notifications with Amazon SNS.
In addition to sending direct push notification messages, you can also use Amazon SNS to send messages to mobile endpoints subscribed to a topic. The concept is the same as subscribing other endpoint types, such as Amazon SQS, HTTP/S, email, and SMS, to a topic, as described in What is Amazon SNS?. The difference is that Amazon SNS communicates using the push notification services in order for the subscribed mobile endpoints to receive push notification messages sent to the topic.
Setting up push notifications with Amazon SNS
-
Obtain the credentials and device token for the mobile platforms that you want to support.
-
Use the credentials to create a platform application object (
PlatformApplicationArn
) using Amazon SNS. For more information, see Creating an Amazon SNS platform application. -
Use the returned credentials to request a device token for your mobile app and device from the push notification service. The token you receive represents your mobile app and device.
-
Use the device token and the
PlatformApplicationArn
to create a platform endpoint object (EndpointArn
) using Amazon SNS. For more information, see Setting up an Amazon SNS platform endpoint for mobile notifications. -
Use the
EndpointArn
to publish a message to an app on a mobile device. For more information, see Direct Amazon SNS mobile device messaging and the Publish API in the Amazon Simple Notification Service API Reference.