I have something like this in a Node app:
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 fine, the notification arrives and goes to the tray if the app if not opened. But if I send a new notification to the same registrationId, the old notification is "updated" (or removed) and only the new one is shows.
If I add a random integer as parameter to notId
message.addData("notId", parseInt(Math.random() * 25));
the notifications are kept in the tray, but then the tray start to show multiple notifications. Is there a way to group the notifications?