Reputation: 2499
I am developing an android chat application using gcm css. My question is that I have already registered user on my xmpp server and I want to login those user using gcm xmpp. I read the google developer tutorials for cloud messaging https://developers.google.com/cloud-messaging/gcm, but there are not much information as per my requirement.
I have some other query as well:-
1) Is gcm server manage users if manage how it manage? Now, We can send message like push notification on particular registration Id. (Using Downstream), But if user uninstall and install the app again then registration id will be changed. So, In this case how can we manage? Will I need the separate server?
If any one have idea. Please reply.
Thanks in advance...
Upvotes: 1
Views: 71
Reputation: 3183
You should need server in order to handle these things. You need to call your registration mechanism in service class of android; When you get the registration token from GCM during registration save that token in shared preference and send that GCM token with identity such as mobile number/IMEI/Email ID back to the server.
If next time service restarts or GCM token get changes compare with it in shared preference and send the info to server if it doesn't match. In server you can have rest-api/php/java or any other back end tech which will receive request from mobile if in case registration ID changes.
I have checked below links during development which really helped me could help you in case.
Upvotes: 0