Here is an instruction of using Node.js to send JSON data payload to a client device with Google Firebase Cloud Message service.
- Setup and Configure Google Firebase on the client device (Android, iOS). An Android sample of integration of Firebase core and message can be found here. Locate and note the client device token, and the firebase server key.
- On Node.js server side, sending downstream message to Firebase API with NPM package “request“. Sample code can be seen below.
- Detail information is documented here (downstream message) and here (Message description) at Firebase website.