I am using the cordova plugin for GCM at GCM-Cordova. On the server side, I am using ToothlessGear's node module.
I think I am not going to use a 'collapsible' key as I require a payload to be sent to the client. The problem I am facing is that the message keeps on arriving after an interval of about 30 seconds. Why is the google server not realizing that the message has been received? Do I have to explicitly do something to stop repeating notifications?
The node-gcm code for triggering push :
gcm = require('node-gcm');
message = new gcm.Message();
sender = new gcm.Sender(app.settings.gcm.server_key);
registrationId = [];
registrationId.push(regid);
message.addData('title', 'Payment Request');
message.addData('message', JSON.stringify(someObj));
message.delayWhileIdle = true;
message.timeToLive = 3;
sender.send(message, registrationId, 1, function(result) {
return console.log(result);
});