Skip to content

The following guide provide some details on how to add the Firebase Admin SDK to your server to send Firebase Cloud Messaging (FCM) messages to android devices.

License

Notifications You must be signed in to change notification settings

claykabongok/Firebase_Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Firebase Integration with Application server

Firebase Integration

The following provide some details on how to add the Firebase Admin SDK to your server to send Firebase Cloud Messaging (FCM) messages to android devices. I have implemented the following using Java with the Spring boot framework, check the documentation for more details .

I will assume you have completed the following before proceeding: connected your application to firebase.

According the documentation the Admin SDK lets you interact with Firebase from privileged environments to perform actions such as reading Realtime Database, programmatically send Firebase Cloud Messaging messages and more.

Steps to follow:

  • Make sure that your server runs the following: Admin Java SDK – Java 7+ (recommend Java 8+), check the documentation for other SDK. The following is also supported Node.js, Python, Go and .NET read the guide for more details.
  • Set up a Firebase project and service account
  • Add the SDK: install the SDK for the language of your choice in my case java with Maven as build automation tool (Add the firebase-admin dependency to your pom.xml file).
  • Authentication using service account: Generate a private key file for your service account (check the documentation for more details), download the JSON file (containing the key)
  • Initialize the SDK using the key generated
  • At this stage your App server should be able to connect to Firebase.

Once you have successfully completed the steps listed, your app server should be connected to Firebase.

Firebase Integration

The process of sending FCM messages (as illustrated in the diagram above):

  1. Device registration: when user installs the app
  2. Generate device token: FCM will assign a unique token to each device
  3. Upload token to back-end: this allows you to send FCM notification to a specific user depending on your business rules.
  4. Send Push notification from trusted application server to FCM with Token (s)
  5. Delivers notifications to registered devices

About

The following guide provide some details on how to add the Firebase Admin SDK to your server to send Firebase Cloud Messaging (FCM) messages to android devices.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published