I read the 2 reasons over here when you GCM Registration Id might change:
- You’ll need to re-register every device each time you update your
app.
- You’ll also need to re-register a device if the version of Android it’s running has been updated
P.S: The below old answer's reference has been removed from Google's page.
In addition to @tyczj's answer of change of ID's on updating the app, Google says that it may also automatically refresh the ID's. If you read the second point under the heading Enable GCM on Architectural Overview page, it says:
Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times. Your Android application needs to be able to respond accordingly.
Just an addition info that for handling this case you should have a Broadcast Listener
which could handle com.google.android.c2dm.intent.REGISTRATION
intent, which Google send to the app when it has to refresh the registration ID. The broadcast receiver will have the onReceive
method with an Intent. From the intent you can get the Bundle
using which you can extract the new registration ID from Google. You can save that and send it to the 3rd part server to replace your previous registered ID for that user.