Skip to content Skip to sidebar Skip to footer

Prevent Gcm Client Displaying Messages From Old Reg Ids

I am experiencing a problem with getting duplicate notifications using GCM push notifications on the Android client side. I install the app and register with GCM like so: regid = g

Solution 1:

There's no way to ignore the messages sent to the old reg id.

The best you can do:

  1. In the client side, try to store some app data on the external storage. This would allow you to identify if the app was previously installed on the device, and to tell your server to replace the old reg id with the new one.

  2. In the server side, handle canonical reg id responses from GCM. This won't prevent the sending of a message to an old reg id, but once you send a message to such reg id, you'll immediately remove the old reg id from your DB, and won't send any more messages to it.

Post a Comment for "Prevent Gcm Client Displaying Messages From Old Reg Ids"