Mark Molina
Mark Molina

Reputation: 5077

Android GCM Registration IDs

I successfully implemented GCM in my Android app but how do I know when my application gets uninstalled from a device? I would to delete the registration id in my MySQL database as well. I think Apple has a service which checks for not responding id's when sending is failed but does Google has something similar?

Upvotes: 1

Views: 206

Answers (2)

Yasitha Waduge
Yasitha Waduge

Reputation: 13540

Ideally what you can do is send registration ID and ANDROID_ID to your content management system(to your MySQL database). And listen PACKAGE_REMOVED intent and inside broadcast receiver you can remove that particular registration ID from your MySQL database

Upvotes: 0

Rawkode
Rawkode

Reputation: 22552

Quote from here

Finally, when GCM attempts to deliver a message to the device and the application was uninstalled, GCM will discard that message right away and invalidate the registration ID. Future attempts to send a message to that device will get a NotRegistered error. See How Unregistration Works for more information.

More info here

Upvotes: 2

Related Questions