I made an android app. I used GCM for push notifications. I register the device using GCM when the user is logged in. I use an external MySql database to store user login IDs. It worked fine.
But
When I did the following steps:
- Installed my application on my mobile phone.
- You are logged in with user1 .
- Removed the application from my mobile device.
- The application is installed again.
- You are logged in with user2 .
user1 notifications are still being received on my mobile device, so GCM does not register my device when the application is uninstalled.
I cannot delete a row in the Mysql database when the application is deleted, because I will not know when the application will be deleted, or the user may not have an Internet connection during the removal of the application to delete the row.
Could you suggest me how to solve this problem?
I read that GCM will take some time to unregister the device after deletion.
How to delete a row in mysql when GCM did not register the device?
source
share