Implementing notification sending
In Chapter 6, Progressive Applications powered by Firebase, we introduced how we can integrate the old FCM utility within our NodeJS server. Now the Firebase SDK provides us with more diverse methods to send push notification messages; plus, it plays nicely with other services, so let's see how we can send push notifications directly to our users using nothing but the Firebase Admin SDK.
How to do it...
In order to send push notification messages to users, we need to have their registration_token
; such a token is grabbed from the user browser side, whether it's mobile or desktop. Google Chrome and Mozilla Firefox support this functionality, and at the time of writing this book, Safari included the functionality over nightly build, while MS Edge is still in development. It's all related to whether the Browser OEM support service works or not.
Another way is via native mobile apps; you can retrieve that registration_token
and send it directly to your Firebase...