Search code examples
iosamazon-web-servicespush-notificationamazon-snsamazon-cloudwatch

How to get sent notification records from AWS SNS?


I'm working with AWS SNS API for mobile notification,

along with AWS CloudWatch for message monitoring.

There's currently only 5 metrics to be watched:

  • NumberOfMessagesPublished
  • PublishSize
  • NumberOfNotificationsDelivered
  • NumberOfNotificationsFailed
  • SMSSuccessRate

None of these seems to be like message content, recipient platforms, or delivered date/time. (contents that make more sense to marketers rather than developers)

How could I query the history of all my sent messages or a specific message?


Solution

  • SNS is a wrapper around a number of similar notification APIs. The APIs for Apple (APNS) and Google (Most Android) GCN don't offer any kind of receipt confirmation.

    If you need receipt confirmation you would have to build that into the application on the mobile device to inspect messages received that were for that application and there is no universal way to do that either. The other issue is that you are totally at the mercy of the user authorizing notifications.

    I suggest you incorporate messaging of your own inside the app and have push notifications as an optional enhancement. In order to get badges to work right you also need cooperation with the app since there is no way using SNS to react to actions taken in the app to clear the notifications or adjust the badge value.