1.0.3 • Published 6 years ago

push-notification-kit v1.0.3

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

Push Notification Kit

This Kit serves as a starter kit for Firebase's Google Cloud Messaging and Node.js where you can setup and send push notifications to all subscribed devices on a specific topic.

Features

  • Send Messages to specific topic that devices are subscribed, containing title and body.

Installation

PushNotification Kit requires Node.js v4+, Google Cloud Messaging Activated Account, and a project already setup.

Install the dependencies and instanciate the PushNotification class.

Usage

var PushNotification = require('push-notification-kit');
var pn = new PushNotification('PATH_TO_GOOGLE_SERVICES.JSON');

pn.notify({project_id: 'PROJECTNAME', topic: 'My Topic', title: 'My Title',body: 'Testing Body'}).then((response) => { // -> If message was sent with no error
    console.log(response)
})
.catch((err) => { // -> If there was an error
    console.log(err);
})

License

MIT