I want to troubleshoot Apple Push Notification service (APNs) failures sending push notifications with Amazon Simple Notification Service (Amazon SNS).
Resolution
Configure and view push notification delivery status attributes for Amazon CloudWatch Logs
Follow the instructions in How do I access Amazon SNS topic delivery logs for push notifications?
Device connectivity issues
If the issue is only occurring on a specific device, then make sure that the device isn't blocked from connecting to push notifications. For example, if your firewall is restricting traffic to allow push notifications on your network. For more information, see If your Apple devices aren't getting Apple push notifications on the Apple website.
Amazon SNS APNs endpoints are deactivated
Endpoints get deactivated when push notifications are sent to the endpoints that don't have a valid device token associated with them. For troubleshooting, see Why is my push notification endpoint not active?
Credentials aren't valid
Push notifications aren't received on Sandbox development or production environment
Create the developer and production applications
- Create the developer application by choosing the "Used for development in sandbox" check box. This application has the APNS_SANDBOX string in the Sandbox endpoint.
- Configure the production application by not selecting the "Used for development in sandbox" option. This application has APNS string in the Production endpoint.
- In your application code, use the ARN with only the APNS string for apps that you submit to the Apple's App Store.
For more information, see Apple authentication methods.
Identify and troubleshoot push notification error response codes
- Review your delivery status logs for failed push notification deliveries ("status": "FAILURE").
- Check the failed push notification delivery logs for any other mobile app attributes. Then, follow the action listed for the status code in the Communicating with APN section on the Apple Developer website.
For more information with error codes and troubleshooting, see Handling notification responses from APNs on the Apple Developer website.
Messages show successful delivery but isn't displayed on the device
- The message might get delivered, but it's not displayed on the device. For example, the CloudWatch Logs show a successful delivery, but it's not displayed on the device's system tray. Include log statements in the receive message handler of the application. This helps to determine if the issue is with the notification not received by the device or not displayed in the system notifications tray. For more information, see Handling notifications and notification-related actions on the Apple Developer website.
- If messages are received as notification payload but not as silent payload, then review the message handler in the client application code. Make sure that the received notification is pushed to the device's system tray. For more information, see Pushing background updates to your App on the Apple Developer website.
- Check what the intended action is for the message types and verify that the client application is compatible. For more information, see Sending notification requests to APNs on the Apple Developer website.
Related information
How do I create an APNs platform application for sending push notifications in Amazon SNS using the AWS CLI?
How do I troubleshoot Firebase Cloud Messaging (FCM) mobile push notification failures in Amazon SNS?
Monitoring Amazon SNS topics using CloudWatch
Mobile push notifications