Why firebase is needed for android notifications along with third party notifications provider such as OneSignal, Pubnub & pusher? - react-native

I'm working on react native push notifications. i'm looking for some answers before i make a purchase to any third party notification provider
Why do third party notifications providers such as OneSignal, Pusher & PubNub are based on Firebase Cloud Messaging?
Can't they send notifications independently without relying on Firebase. why pay more to third party providers when FCM does the work for free?

Firebase is a Brand of Services
First, Firebase is a brand that encompasses more than just 1 thing. For example, there is Firebase the realtime database, and there is FCM (Firebase Cloud Messaging) which is the current incarnation of GCM (Google Cloud Messaging) which came from the original product, C2DM (Cloud to Device Messaging).
PubNub and others are push gateway providers
Second, third party realtime messaging services are not push notification services, rather they offer push notification gateways to the push services: APNS for iOS and FCM for Android.
PubNub Realtime Messaging & Mobile Push Notifications
In PubNub's case (my employer), we provide a realtime messaging service (publish, subscribe and much more) and if you provide a valid APNS and/or FCM payload, we will not only deliver that realtime message to active subscribers, we will also send a mobile push notification to the devices that are properly registered for them on that channel you published the message to. This allows the message to be delivered when the app on the device is either not active (background) or not running and therefore, no active connection to PubNub unless it is running in a background service). Now you can have an active connection to PubNub in the background with proper implementation and permissions from the owner of the device (easier on Android than on iOS which also has a review process that rejects apps that don't qualify as valid background service apps).
For Your Consideration
If you did not use a service such as PubNub or one of the other realtime messaging vendors or a push notification specific service like Urban Airship, you would have to implement your own server-based push notification service which is possible but might be more work than you would expect especially if it needs to scale, be secure, robust, etc.
The real question you should ask is do you need realtime messaging in your app or just push notifications and to what level of scalability where it is worth paying a third party for all that goodness.

Related

Best Approach for Push Notifications for both IOS and Android

I am building the backend for our company's mobile app and we need to send notifications to users from API based on some events. I need some advice on how I can implement this. I am looking for a platform where I can send notifications for both IOS and Android. I recently came across Firebase and got some info that the mobile-app will send a device token to the server, then we will handle the push notification using this token. My assumption here is, I need to save this device token for all the users in a database and send the notification as necessary. Is this the best approach or are there any other good approaches for this? I am pretty sure there will a lot of solutions where I do not have to handle this myself (in database)
I was also looking into Azure Notification Hub for this, but the cons I felt here is that my UI guy (outsourced) is developing the application in React Native and I have not seen any good examples of React Native using Azure Notification Hub.
I am expecting around 1000 users for my application and I am developing my backend in ASP.NET WebAPI. Mostly I will have 2 types of notification
Push notification to specific user.
Push Notification regarding new installations to all the users
Well, according to my experience the best way and the easiest way is using firebase. You will have a lots of option there. In fact according to their comment, whether you're a beginner, intermediate or advanced React Native developer you can be up and running with React Native Firebase in no time.
https://www.npmjs.com/package/react-native-firebase
For more information and adding a project:
https://rnfirebase.io
Firebase getting start:
https://github.com/invertase/react-native-firebase-starter
How does it work?
Firebase Cloud Messaging architecture diagram
An FCM implementation includes two main components for sending and receiving:
A trusted environment such as Cloud Functions for Firebase or an app server on which to build, target, and send messages.
An iOS, Android, or web (JavaScript) client app that receives messages.
You can send messages via the Admin SDK or the HTTP and XMPP APIs. For testing or for sending marketing or engagement messages with powerful built-in targeting and analytics, you can also use the Notifications composer.
last comment copy-right: https://firebase.google.com/docs/cloud-messaging/

Sending Push Notification To All People Who Have Enabled Notifications For My Progressive Web App

I am in the process of developing a new site and have decided to add progressive web app capabilities to the site. I have set it all up correctly and I can send push notifications to devices with whom I know the endpoint via FCM with a cURL command.
My question is how do you send one to all users who have enabled notifications on my site without knowing a list of all users unique endpoints.
If you are using the Firebase Cloud Messaging Web SDK you should be able to get the Firebase token and subscribe that token a topic using the server side API and then you can message the topic.
NOTE: This requires the use of the Firebase Web SDK to work. This is not supported with the raw Web Push API.

Should I be worried about the current PubNub configuration when I upgrading to FCM?

While reading through GCM documentation, I found the alert message from the site:
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits
the reliable and scalable GCM infrastructure, plus new features! See
the FAQ to learn more. If you are integrating messaging in a new app,
start with FCM. GCM users are strongly recommended to upgrade to FCM,
in order to benefit from new FCM features today and in the future.
How does it affect to current running PubNub configuration when I upgrading to FCM? I'm still not sure if ugprading from GCM to FCM will be just a snap.
Upgrade to GCM
PubNub Mobile Push Gateway - GCM to FCM
FCM is mostly just a rebranding of GCM (GCM used to be called C2DM and this is similar transition). It appears the changes are primarily client side (easier to user SDKs). PubNub (and other GCM push providers) do not have to make any changes on the server side at this time.
As always, PubNub will continue to monitor updates to push notifications services like GCM and APNS and provide new features as needed.
Please contact PubNub Support if you have any issues using GCM/FCM with your PubNub enabled applications.
For more details about using GCM/APNS with PubNub, see these resources:
Sending APNS and GCM Messages to Subscribers and Mobile Push Notification Services in One API Call
Android V4 Mobile Push Gateway Tutorial
Mobile Push Notification Gateways, APNS, GCM, and Data Streams Explained (video)
How can I troubleshoot my push notification issues?
I don't think there will be any issue moving your client from GCM to FCM. A client that implements FCM can receive messages sent to GCM, it is the same infrastructure. If PubNub is sending messages through GCM then your FCM client be able to handle those messages.
Note that GCM is still being supported. So if you are concerned about PubNub's implementation then sticking with GCM is a valid option.

What is the difference between notifications of Firebase and FCM?

I am using Firebase, but I don't know what is different between notifications in Firebase and FCM.
I think notifications of Firebase can only send messages, whereas FCM can send and get messages.
Is it right?
Firebase Notifications is built on Firebase Cloud Messaging and shares the same FCM SDK for client development. For testing or for sending marketing or engagement messages with powerful built-in targeting and analytics, you can use Notifications. For deployments with more complex messaging requirements, FCM is the right choice.
https://firebase.google.com/docs/cloud-messaging/#how_does_it_work
Use the Notifications console GUI to compose and send notifications to all supported message targets. Firebase Cloud Messaging handles the routing and delivery to targeted devices.
Firebase Notifications offer a console which users can use to send a notification without writing a single line of code. So, it is used to create and send the notification
Firebase Cloud Messaging is a cross-platform messaging solution that lets you reliably deliver messages at no cost. So, it is used to route and deliver the message/notification
source:
https://firebase.google.com/docs/notifications/
https://firebase.google.com/docs/cloud-messaging/
https://www.youtube.com/watch?v=KpTSpVh9SfY

BlackBerry push client application subscription

I have few things to be clarified in BlackBerry push client applications. I have developed an push-enabled application which can receive push messages from the sample push initiator application installed on a publicly accessible location (through BIS). I have now run into a question about sending personalized messages to each device. For that matter I need to use subscription API that comes with BlackBerry push SDK. This question is similar to what has been posted here, but it contains no information for me. My questions are,
I used the registration API for BlackBerry client app registration to receive push messages from PPG. It requires only app-ID, device-port and push URL(not push initiator URL). Client app registers itself when the application UI starts up(this is how I register with push API). Is this all I need to do to get a subscription for that client with push initiator or does client need to contact push initiator directly for a subscription?
Why do I need to provide subscribe/unsubscribe URLs in the push initiator application (I don't provide any unsubscribe/subscribe facility in the client push application ) or is there a way to achieve this through application manager/operating system? or do I need to get unsubscribed users from the PushResult object and process them?
How does push initiator come to know about clients initially when there is no mechanism for the push client to subscribe with push initiator?
Is there a blog post or tutorial describing each and every step involved in the entire communication process apart from the documentation materials provided by RIM?
Currently I am using Push Essentials but might migrate to Push Plus service later(in the distance future).
Kindly appreciate your quick response.
Ok, so there are 2 things to keep in mind:
1) The BlackBerry Infrastructure (Push Proxy Gateway or PPG) needs to have your device listed as subscribed for your specific application ID in order for pushes to be delivered to your device. Subscribing from the device registers it with the PPG and tells the PPG "I would like to allow pushes from this App ID to be delivered to me". If your device is not subscribed to the PPG then your pushes from the initiator will be sent, accepted by the PPG but never allowed to be delivered to the target device.
2) Even if the device is registered with the PPG, how does your server sending the pushes keep track of what devices are registered? This is done by registering with the Push Initiator. The client sample application included with the Push SDK has a mechanism to show how this can be done. As well the server sample is set to receive these requests and add the client to the database so that it can be included for future pushes.
With all that in mind what happens if:
1) The user un-installs the application
2) The user switches devices
In the above cases there needs to be a mechanism to de-register the device from receiving pushes both from the PPG and from your server Push Initiator. Again the client sample application shows how this can be done.