Skip to content Skip to sidebar Skip to footer

Gcm Notification Duplication Issue. Received Same Message Many Times

I have noticed one issue in dealing with GCM. If you un-install the app and install it again the GCM registration id is changed for that device. And previous registration id is sti

Solution 1:

You can solve this issue, with the use of canonical_id which is part of the response of GCM when called for sending push messages. Canonical Id can be used to detect duplicate register ids and you can use to prevent the problem.

Also you can read more about it in the following links

1- How to get Canonical Id from GCM ?

2- How to resolve the GCM duplicate messages problem ?


Solution 2:

You can delete previous GCM id stored in you database while inserting new GCM id for the same user or device if you can track the same user somehow for example by loginid.


Solution 3:

As mentioned in the guideline of GCM

Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times. Your Android application needs to be able to respond accordingly.

You can replace the old GCM in your database instead of keeping duplicate copies as multiple Registration Ids are the reason for multiple push notifications.


Post a Comment for "Gcm Notification Duplication Issue. Received Same Message Many Times"