I am little bit confused in validating the GCM token. I am working in cross platform application using Sencha framework and my server side is in Java. I have a query regarding how to validate the registration ID (GCM token)? Is there any specific API to validate the GCM token? Can you guide me how to handle this, either in client side or server side? I have already did registration part in server side, where user can register their GCM token in database. Now I need to validate this registration token.
Is unregistering the application every 2 weeks a good approach ?
You register to GCM and un-register from GCM in the client side. That's where you get the registration ID from Google.
Once you have a registration ID, you should consider it valid until :
You send a message with the registration ID to Google's GCM Server and get a NotRegistered or InvalidRegistration error. In these cases you should remove the registration ID from your DB.
You send a message with the registration ID to Google's GCM Server and get a successful response, but the response contains a canonical registration ID. In this case you should replace the registration ID with the canonical registration ID.
The app explicitly un-registered from GCM, and notified the server about it, in which case you should remove the registration ID from your DB.
I don't see any point in un-registering the app every two weeks. Google's code samples only re-register the app once a new version of it is installed, and even then they don't un-register before re-registering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With