Error registering Gcm device in android

I am currently working with a push notification in android.its, working fine.but my problems are: I get multiple notifications instead of a single notification. Then I check my registration table and find a strange fact, every 30 minutes my device id changes, so the same user_id resist several devices and get the number of notifications together. I do not know why this happened. I am using Samsung galaxy s2 for testing. please help me.

+4
source share
1 answer

I am not sure why your registration ID changes every 30 minutes. Perhaps if you post your registration code, I can tell. Regardless of this problem, your server should be able to handle multiple registrations for the same device. When you send the registration identifier to your server, send it another unique identifier created by your application or your server, and this will allow you to identify when you will receive a new registration identifier for an existing device, in which case you will replace the old registration identifier with new.

Another thing you have to do on the server is to handle the case where the gcm server returns the canonical registration identifier, in which case you must replace the identifier that you used to send the canonical message.

+3
source

All Articles