I was wondering how will app/device be notified if GCM server decides to refresh the registrationId which the app previously retrieved from the GCM server. Currently, I save the 1st retrieved registrationId and save it in the database and send this registrationId to App server. So, from next time App won't be talking to GCM server. In this case App will never know if the registrationId is changed by GCM server. Google document suggest something to handle the case, but it does not mention what steps should be taken. Quote from Google -
Although the com.google.android.c2dm.intent.REGISTRATION intent is typically received after a request was made by the application, Google may periodically refresh the registration ID. So the application must be prepared to handle it at any time.
Any suggestion will be helpful,
Thanks, SKU
The old reg id continues to work for a while but Google send out a new one to be used in future in the canonical_id field of the response.
来源:https://stackoverflow.com/questions/13689530/how-to-handle-gcm-changing-the-registration-id