Skip to content

A Node module that helps you send push notifications for Android and iOS

Notifications You must be signed in to change notification settings

grillorafael/push_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!');
});

About

A Node module that helps you send push notifications for Android and iOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published