How does GCM handle app uninstalls?
If your end user does not unregister your app before they uninstall it, the app will remain registered with the Google Cloud Messaging (GCM) servers and AirBop for a time but not forever. The device will eventually be unregistered from AirBop and the GCM servers; however a few things need to happen first.
What happens is documented in the GCM documentation in the Unregistering from GCM section:
- The end user uninstalls the application.
- The 3rd-party server sends a message to GCM server.
- The GCM server sends the message to the device.
- The GCM client receives the message and queries Package Manager about whether there are broadcast receivers configured to receive it, which returns false.
- The GCM client informs the GCM server that the application was uninstalled.
- The GCM server marks the registration ID for deletion.
- The 3rd-party server sends a message to GCM.
- The GCM returns a NotRegistered error message to the 3rd-party server.
- The 3rd-party deletes the registration ID.
So once the GCM client on the Android device informs the GCM servers that the application was uninstalled, GCM will notify the AirBop servers of the uninstallation / unregistration the next time you try to send a message to your app. Once that has happened AirBop will unregister the device from your AirBop account.