Question

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

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top