Reputation: 10619
Every App has its own Registration ID when using GCM. Is that true right or does every User has its own Registration ID? I need to know that because if it is one Registration ID for each Application i need to implement something to handle the scenario that a user uses the device of another user to login to the application. I store all Registration ID's in the database one for each user. So if i for example have:
And User B is now logging in using Device A i have to update the Registration ID in my Database for User B and it will set to the Registration ID of the App on Device A. So User A and B will temporally have the sam Registration ID until User B logs in on Device B again and i update my Database.
I hope you understood what i mean and can tell me if this is how i need to do it to make sure that every user gets his/her push notifications even when he is logged in on another device.
Would it be also a good idea to delete the registration id from the database when the user is logging out?
Upvotes: 0
Views: 73
Reputation: 95639
The registration ID is intended to provide a connection between an instance of your application on a device and your servers so that you can route messages to an appropriate device. You will probably want to separately maintain an association between devices and users so that, given a message to a user, you can route that message to all the devices belonging to that user; however, conceptually, you should think of the registration ID as identifying your application (not a specific user) on a specific device.
Upvotes: 1