I'm currently implementing GCM into an application with login system. I wanted to send notification to the application based on the user that logged in to the application (one device, multiple user). I go through these processes.
- Login as "user A"
- Register GCM (get Registration ID) send to server side
- Broadcast Notification out to user A
- Logout un-register
- Login as "user B"
- Register GCM (get Registration ID -occasionally get back same registration ID with user A, sometimes return as different registration ID-)
- GCM push notification to user A (even if the user un-register)
I'm not sure how to let the application identify the user that logged in to the device and push notification to that specific user only. Instead of user B logged in and get user A's notification. Any comments and answers will be highly appreciated! If you need check on specific codes from my project, please do let me know.