Closed abhaygarg closed 8 years ago
Hi @abhaygarg!
I am having some trouble understanding your question. In the code you have shown you are only sending one notification, and you have not shown any output from the given code (what happens, what you expected to happen, etc).
Thanks for reply, Actually this code is used for sending push notification , and we placed this code in a method and calls every time when notification is generated ,
sender.send(message, user.mobileId, 4, function (a,result) {
console.log("ok",a);
console.log("why",result);
//console.log("ok",registrationIds);
});
So our problem is lets suppose we send push notification to a user and user does not open that notification and on server there is another notification is generated then we send another push notification to that user . So after that the notification is updated and new notification is show on mobile and previous did not
@abhaygarg this sounds like a client-side implementation issue - are you sending to iOS or Android?
If you're sending to Android devices, make sure you aren't using the same NOTIFICATION_ID
when issuing out different notifications, as previous ones will be overriden:
// Sets an ID for the notification - make sure to change this for different notifications
int mNotificationId = 001;
// Gets an instance of the NotificationManager service
NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
// Builds the notification and issues it
mNotifyMgr.notify(mNotificationId, mBuilder.build());
We use IONIC framework at client site , upon debugging we find that we send the same notId , now we send different notId from server and problem is solved Thanks for your support
Hi abhaygarg, eladnava
I'm sending the notification Id as below. But i can see only the last notification message. Do i need to make any changes at the client side ? We are using the Ionic framework at client side.
var message = new gcm.Message();
message.addData('message',msg.details.message);
message.addData('title',msg.details.appId);
message.addData('msgcnt','1');
**message.addData('NOTIFICATION_ID',this.androidcount++);**
sender.send(message, registrationIds, function (err, result) { });
Thanks Manoj Badam
@manojbadam please create a new issue with your question, it does not seem to be the same as the original question :smile:
So our notification send successfully but the problem is only latest push notification show , we wants that if we send multiple notification to single user then different notification shows