1.0.3 • Published 9 years ago

fcm v1.0.3

Weekly downloads
278
License
-
Repository
github
Last release
9 years ago

node-fcm

An interface for "Firebase Cloud Messaging for Android" on Node.js

Installation

Via npm:

$ npm install fcm

Usage

var FCM = require('fcm').FCM;

var apiKey = '';
var fcm = new FCM(apiKey);

var message = {
    registration_id: 'Device registration id', // required
    collapse_key: 'Collapse key', 
    'data.key1': 'value1',
    'data.key2': 'value2'
};

fcm.send(message, function(err, messageId){
    if (err) {
        console.log("Something has gone wrong!");
    } else {
        console.log("Sent with message ID: ", messageId);
    }
});

See FCM documentation for details.