Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push notifications: Why use Amazon SNS over Google's GCM/FCM?

I have created a mobile app for Android and iOS using Phonegap Build. Last year I had nearly finished writing code to use GCM (Google Cloud Messaging) for remote push notifications - which can go out via Apple's APNS too - but the project was shelved.

This year the project is resurrected and I find Google has changed everything to Firebase (FCM). I then read some enticing things about Amazon SNS handling notifications. Just when I started to think SNS might be a better option, I noticed you still have to set up GCM/FCM anyway, and pass all those details to SNS.

So is there any benefit to using SNS when I've got to do the full FCM setup as well?! Both services seem to offer the same features: interact with APNS if required, subscribe to topics, provide you with a nice API/SDK, etc. The app code, and the server-side code would be no simpler, as far as I can see. Why add another layer (SNS) on top of FCM?

(I'm trying not to let this be an opinion-based question: I want to know whether SNS is saving me any effort, giving me any advantage, or adding any features that FCM does not have.)

like image 949
Magnus Smith Avatar asked Dec 16 '16 12:12

Magnus Smith


People also ask

Does AWS SNS use FCM?

Yes FCM is compatible with SNS, you need to be a bit careful about the payload as the format is a bit different.

What is difference between FCM and GCM?

FCM is a cloud platform that provides messages and push notifications for operating systems- ios and Android, and websites as well. Google Cloud Messaging is a messaging service that enables the message transfer from server to clients apps.

What type of notification mechanism does Amazon SNS use?

Amazon SNS follows the “publish-subscribe” (pub-sub) messaging paradigm, with notifications being delivered to clients using a “push” mechanism that eliminates the need to periodically check or “poll” for new information and updates.

Can I send push notifications without FCM?

How it is possible? It's definitely possible -- you don't have to use Firebase to deliver push notifications.


2 Answers

Just some thoughts.

  1. If you are already using some mobile AWS SDK, then it's more convenient to use it for SNS too.
  2. That also helps keep your app smaller.
  3. And you're happier as a developer since API calls are somewhat unified.
  4. If your backend is hosted on AWS infrastructure you can use IAM roles for EC2 instances (also Lambdas etc.) to make those call without access key/secret key.
  5. You get metrics in your CloudWatch.

But Firebase Cloud Messaging is free :)

like image 164
Sergey Kovalev Avatar answered Oct 19 '22 21:10

Sergey Kovalev


Let's answer a few questions first.

1.Do you want to develop, maintain and run the code to talk to GCM?
2.Do you wish to do the same for another platform (iOS, Kindle Fire), if you choose to develop your app for other mobile platforms.
3.Do you want to manage change of registration_id's by yourself?
4.Do you care if a notification is delivered to your users a few milliseconds later?
If you answered NO to any of the questions above, I recommend using SNS to deliver push notifications to iOS, Android and Kindle Fire devices.

SNS talks to GCM to deliver notifications to android devices. Here is what SNS can offer you.

Simple API to send notification to heterogeneous platforms.
Manages application registration_ids. As a developer you don't have to worry about change of registration_ids.
Scales really well. You don't have to worry about managing infrastructure if your app becomes super popular.
Can tolerate GCM downtime & throttling.

like image 27
narendra Avatar answered Sep 21 '22 19:09

narendra