Doubt about Registration ID in Google Cloud Message

Asked

Viewed 327 times

2

I want to implement GCM in my project, but I have some questions and I needed to take them all before doing.

Well when I log a device into the GCM server, is the id it receives unique? If I uninstall the application and install again, I can guarantee that that device is already registered, IE, it uses the id that was created only once?

I wanted the user to be able to register on one device, but when he logged on to another device having the same GCM id, so that two devices received the message together, but this is not possible certain?

  • From what I read in the documentation, Registration ID is unique to the Device/App pair (except for updates that it is not recommended to use the same ID). If you uninstall and install (in the same version) the ID is the same. Check out these links: http://developer.android.com/google/gcm/adv.html#reg-state e http://developer.android.com/google/gcm/gcm.html.

1 answer

2


Well when I log a device into the GCM server, is the id it receives unique? If I uninstall the application and install again, I can guarantee that that device is already registered, IE, it uses the id that was created only once?

Answer:

Yes, it is guaranteed even with uninstallation, because the Registration ID would be the IMEI of the device.

I wanted the user to be able to register on one device, but when he logged on to another device having the same GCM id, so that two devices received the message together, but this is not possible certain?

Answer

Creates a user data persistence structure, where you store registration_id at login to send push notifications to users.

Example:

Table of registration_id

gcm_id | id_usuario |

1          2
2          2
3          1

User Table

id | nome |
2    Caio
3    Julio

Triggers notifications Caio for cell phones IMEI 1 and 2

Browser other questions tagged

You are not signed in. Login or sign up in order to post.