Am using node-gcm in my sails js application to send push notifications to android devices.But when am calling the method:
// Set up the sender with you API key
var sender = new gcm.Sender('my-api-key');
var registrationIds = [];
//push the device id's to array
for (var i = 0; i < users.length; i++) {
registrationIds.push(users[i].Device_Id);
}
// ... trying only once
sender.sendNoRetry(message, registrationIds, function(err, result) {
if (err) {
console.error(err);
} else {
console.log(result);
}
});
Am getting the error TypeError: Object.keys called on non-object
Am using
node-gcm
in my sails js application to send push notifications to android devices.But when am calling the method:// Set up the sender with you API key var sender = new gcm.Sender('my-api-key'); var registrationIds = []; //push the device id's to array for (var i = 0; i < users.length; i++) { registrationIds.push(users[i].Device_Id); } // ... trying only once sender.sendNoRetry(message, registrationIds, function(err, result) { if (err) { console.error(err); } else { console.log(result); } });
Am getting the error TypeError: Object.keys called on non-object