push_service

0.1.0 • Public • Published

Push Service for Node

This is a Node module to work with push notifications for iOS and Android.

It will work with other devices later.

How it works

npm install push_service --save
var push = new require('push_service')({
    apnKeyDevel: 'path/to/developmentKey',
    apnKeyProd: 'path/to/productionKey',
    apnCerDevel: 'path/to/developmentCertificate',
    apnCerProd: 'path/to/productionCertificate',
    apnPassphrase: 'Your APN Passphrase',
    gcmSenderId: 'Your Google GCM SenderID'
});
 
var message = {
    title: 'Your message title',
    message: 'Your message message',
    to: 'token or array of tokens', // [token1, token2, token3]
    data: { // Your payload
        messageId: 10,
        messageInfo: 'This info you arrive to your device as a payload'
    }
};
 
push.sendTo('android', message).then(function() {
    console.log('Message sent!');
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i push_service

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • grillorafael