Skip to content

Instantly share code, notes, and snippets.

Last active June 25, 2016 06:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var gcm = require('node-gcm');
var message = new gcm.Message();
var message = new gcm.Message({
collapseKey: 'demo',
delayWhileIdle: true,
timeToLive: 3,
data: {
key1: 'demo title.',
key2: 'push demo'
var server_access_key = 'push provider access key value';
var sender = new gcm.Sender(server_access_key);
var registrationIds = [];
var registration_id = 'android registration_id value';
* Params: message-literal, registrationIds-array, No. of retries, callback-function
sender.send(message, registrationIds, 4, function (err, result) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment