JSPM

etm-fcm

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q9859F

An interface to Firebase Cloud Messaging for Android (FCM) on Node.js. Forked from nandarustam/fcm-push

Package Exports

  • etm-fcm

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (etm-fcm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-fcm

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

Installation

Via npm:

$ npm install etm-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.