Skip to content

A simple Node.js script to send notifications to an iOS or Android device using Firebase Cloud Messaging.

License

Notifications You must be signed in to change notification settings

quiin/simpleFirebaseNotifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Firebase Notifications

A simple Node script to send notifications to an iOS or Android device using Firebase Cloud Messaging.

How to run

npm install -s
node notification.js

if the notification was sent, done! will be printed in the console, the error will be printed otherwise.

Considerations

This is just an example and the following variables MUST be changed to your custom values in order for this to work:

  • client1

    This is the firebase token retrived by the device.

    Visit Android instructions and this and this for iOS instructions.

  • API_KEY

    Can be found in the firebase console, click in the 3 vertical dots in your proyect and then under the tab cloud messaging

  • serviceAccount

    This is the .json file you download form firebase

  • databaseURL

    Can be found in the firebase console under database

For further information about Firebase Cloud Messaging and how to build more complex notifications, please visit https://firebase.google.com/docs/cloud-messaging/downstream

About

A simple Node.js script to send notifications to an iOS or Android device using Firebase Cloud Messaging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published