I have something like this in a Node application:
var sender = new gcm.Sender("XPTO"); var registrationIds = ["whatever"]; ... var message = new gcm.Message({ data: { avatar: body_data.avatar, message: body_data.message } }); sender.send(message, registrationIds, 4, function (err, result) { console.log("success"); });
It works great, a notification arrives and goes to the tray if the application does not open. But if I send a new notification to the same registration ID, the old notification will be “updated” (or deleted) and only the new one will be shown.
If I add a random integer as parameter in notId
message.addData("notId", parseInt(Math.random() * 25));
notifications are saved in the tray, but then the tray starts showing several notifications. Is there a way to group notifications?
source share