Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SNS Mobile push notifications extremely confused

Right now I'm trying to send mobile push notifications to my phone when someone publishes a message to SNS. I'm confused about what services I have to use. Do I have to use a 3rd party service like Firebase Cloud Messaging/GCM to send mobile push notifications? Or can I send it directly from SNS to my phone.

In AWS docs it's a bit contradicting to me.

https://docs.aws.amazon.com/sns/latest/dg/sns-mobile-application-as-subscriber.html

It says:

To begin using Amazon SNS mobile push notifications, you need the following:

A set of credentials for connecting to one of the supported push notification services: ADM, APNS, Baidu, FCM, MPNS, or WNS.

A mobile app that is registered and configured to use one of the supported push notification services.

So that means we have to use a third party service right? But however in one of the AWS SNS tutorials:

https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html

it says we can create a platform endpoint for my mobile device so that it can recieve push notifications. I am extremely confused, do we have to use a third party service or can we send SNS push notifications directly to our phone?

I checked stackoverflow and the answers are not clear to me either

Can Amazon SNS push notifications directly to mobile devices?

Amazon SNS Sending direct push notification to individual device

Can someone please clarify this for me?

like image 641
WHOATEMYNOODLES Avatar asked Aug 29 '19 07:08

WHOATEMYNOODLES


People also ask

Why push notifications are not reliable?

Android push notifications sent via GCM / FCM are not reliable due to various issues with GCM's underlying architecture [1] [2] [3]. Push notifications may be delayed, rate-limited, lost in transit, or arrive in a different order than which they were sent.

What are the limitations of push notifications?

2. Push notification character limit - Pay attention to the message length. By default, the iOS allows a character limit anywhere between 150 – 230 characters, and the Android notification tray allows anywhere between 450 – 650 characters.

Are push notifications spam?

Firstly, push notifications used to look like a spam email but get developed into personalised, interactive notifications that provide information and value with the shortest wording possible. They can be triggered based on a user's request or the action performed by a user.


1 Answers

AWS SNS manages and abstracts different push notification services.

For AWS SNS to be able to make use of the appropriate push notification service, it would need a platform endpoint. It would need to know which platform (i.e iOS) an app is built.

it says we can create a platform endpoint for my mobile device

To create a platform endpoint, you would need a certificate coming from the Push Notification provider.

  • Example: .p12 is a certificate from Apple which will require "Push Notification" feature to be enabled.

Once a platform application is created, the app would need to register a unique device token to AWS SNS.

This device token is generated by iOS or Android to uniquely identify the device. The app can only generate the device token if it's properly signed by a certificate from the Push Notification provider.

do we have to use a third party service

Yes you need a third party service to:

  1. generate the certificate with push notification feature enabled
  2. generate the device token associated with your physical device
  3. properly sign the app using the certificate

or can we send SNS push notifications directly to our phone?

AWS SNS manages this for you by matching device endpoints to the correct device token. Then invoking the appropriate push notification service. (i.e APNS, GCM).

like image 107
Joseph D. Avatar answered Nov 14 '22 11:11

Joseph D.