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:
- Device A of User A
- Device B of User B
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?