Closed manojbadam closed 8 years ago
@manojbadam how are you sending multiple push notifications to the same device? I see that you send a registrationIds
array, did you purposefully insert a specific device registration ID twice to that array?
@eladnava No, i will be calling by API twice. Example scenario: at 12.00 PM - Notification was sent to DeviceID/registrationID xxxx (NoticificationId is 1) at 12.05 PM - Notification was sent to DeviceID/registrationID xxxx (NoticificationId is 2)
when i check my the mobile at 12.10 PM, i can see only the message received at 12.05 PM. I cant see the message received at 12.00 PM.
Thanks Manoj Badam
@manojbadam are you by any chance supplying a collapseKey
in the gcm.Message
?
This parameter identifies a group of messages that can be collapsed, so that only the last message gets sent when delivery can be resumed. This is intended to avoid sending too many of the same messages when the device comes back online or becomes active (see delay_while_idle).
https://developers.google.com/cloud-messaging/http-server-ref
@manojbadam what does the GCM service return? In the code you have shared it doesn't seem like you are looking at the err
and result
variables returned from the callback. Knowing what these are might help us :-)
Closing the issue due to lack of response. Let us know if you still need help! :+1:
Hi There!
Im having the same issue, especially when I put it in a for loop:
for (var i = 0; i < extIds.length; i++) {
var newBody = body;
newBody.index = i ;
var sender = new FCM.Sender('..........');
var message = new FCM.Message({
priority:"high",
data: newBody
});
console.log(message);
var regToken = extIds[i].device;
var sendResult = await sender.send(message, { to: regToken }, async function (err, response) {
if (err) {
console.log("ERROR!")
// return err;
console.log(err);
}
else{
console.log(response);
// return response;
}
});
}
can you please advise, let me know if you require anymore informtion.
Hi @nervouscat I think it would be more appropriate to start a new issue where we can discuss this :smile: I'm not sure it's the same as the original one, which has been closed.
alright no Problem :)
Hi Team,
We have a cron job running on and sending the push notifications frequently. If i have multiple push messages to the same device, I'm able to see only the last one (overwriting the previous messages). I found a similar Issue #164 and added NotificationId and value(simple counter) to the message payload. But still facing the issue.
I'm sending the notification Id as below. Do i need to make any changes at the client side ? We are using the Ionic framework at client side.
Thanks in advance
MB