Push notifications register different Device Id's in the same Device

0 votes
Hi,

I'm using push notifications with App42 API but it seems to register many times same user with different Device Id's on the same device. It happens sometimes, not always. Any idea why is it?

Thanks so much.
asked Nov 12, 2014 in App42 Cloud API-BaaS by davidrelgr (60 points)

2 Answers

0 votes

Here explains how to work in android:

http://developer.android.com/google/gcm/adv.html#reg-state

 

Canonical IDs

On the server side, as long as the application is behaving well, everything should work normally. However, if a bug in the application triggers multiple registrations for the same device, it can be hard to reconcile state and you might end up with duplicate messages.

GCM provides a facility called "canonical registration IDs" to easily recover from these situations. A canonical registration ID is defined to be the ID of the last registration requested by your application. This is the ID that the server should use when sending messages to the device.

If later on you try to send a message using a different registration ID, GCM will process the request as usual, but it will include the canonical registration ID in the registration_id field of the response. Make sure to replace the registration ID stored in your server with this canonical ID, as eventually the ID you're using will stop working.

 

Is there any way to send push messages to user using the last registration_id¿¿ or a function that returns the registrationid's by user??

answered Nov 12, 2014 by davidrelgr (60 points)
edited Nov 12, 2014 by davidrelgr
0 votes

Hello David,

Your device/register token received from GCM will remain same until you change your package name in manifest. Please make sure that you have same package name to have unique device token.

Thanks

Himanshu Sharma

 

answered Nov 13, 2014 by hs00105 (2,005 points)
That is not true. This is what google says:

"A regID maps an app to a device. It isn't associated with a particular logged in user. If you unregister and then re-register, GCM may return the same ID or a different ID—there's no guarantee either way."

I've not changed package app name.

Thanks.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...