Mobile push notifications best practices - Amazon Simple Notification Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Mobile push notifications best practices

This section describes best practices that might help you improve your customer engagement.

Endpoint management

Delivery issues might occur in situations were device tokens change due to a user’s action on the device (e.g. an app is re-installed on the device), or certificate updates affecting devices running on a particular iOS version. It is a recommended best practice by Apple to register with APNs each time your app launches.

Since the device token won’t change each time an app is opened by a user, the idempotent CreatePlatformEndpoint API can be used. However, this can introduce duplicates for the same device in cases where the token itself is invalid, or if the endpoint is valid but disabled (for example, a mismatch of production and sandbox environments).

A device token management mechanism such as the one in the pseudo code can be used.

For information on managing and maintaining FCM v1 device tokens, see Firebase Cloud Messaging (FCM) endpoint management.

Delivery status logging

To monitor push notification delivery status, we recommended you enable delivery status logging for your Amazon SNS platform application. This helps you troubleshoot delivery failures because the logs contain provider response codes returned from the push platform service. For details on enabling delivery status logging, see How do I access Amazon SNS topic delivery logs for push notifications?.

Event notifications

For managing endpoints in an event driven fashion, you can make use of the event notifications functionality. This allows the configured Amazon SNS topic to fanout events to the subscribers such as a Lambda function, for platform application events of endpoint creation, deletion, updates, and delivery failures.