When a push notifications is arrived, if user is not available to see the notification. he got another notification the previsous is getting updated with the new one. But it should not update with latest one. we need to display each notification separately is that possible using GCM?
I have used Phonegap to develop the application
The PushPlugin supports sending notification Ids in the payload.
When sendingthe GCM message from your server, include a unique data.notId
along with data.message
and data.title
, and you will have separate notifications.
Well, if you look at the implementation of PushPlugin, you'll see that they use a constant notification ID:
public static final int NOTIFICATION_ID = 237;
...
mNotificationManager.notify((String) appName, NOTIFICATION_ID, mBuilder.build());
This would cause every new notification to overwrite the existing one. That's why only the last notification is displayed.
If you want to change the behavior, you have to change the code to use a unique notification ID for each notification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With