How to catch application uninstalling on device an

2019-01-17 23:45发布

问题:

Problem Description:

We have a service which has applications for main mobile OS’s. We use push notifications. When user is log in, we store his device authorization data (lets say token) for later use in the push service. The problem is about few device authorizations for one user and properly keeping them valid when the user uninstall the application.

Example:

I gave my login to system to a few people, in case to try it. They logged in through the mob. application and the system automatically add a few device authorizations into database (tokens). So now we have N device tokens for 1 user. So that if we send push notification everyone will receive it. Now, suppose those who have installed applications want to uninstall it. Without logout they uninstall application through application manager. And at this time we have NOT VALID data for authorized device. And if we try to notify them, notification will be sent nowhere. Which is wrong, and useless work for server. How to let the core know that some of stored data is no longer valid?

Shortly – is there any possibility in Android / iOS to trigger application delete event. If the application is being delete application call server to clean-up data in the storage. Or if the application is open and the user uninstall it, would there onDestroy() trigger fired? Or some other?

I’m not iOS developer, not Android developer, just know a little about second one and nothing of the first. Any advice will be appreciated. Thanks in advance.

回答1:

That depends on which push service you are using. Afaik, if you are using C2DM, the act of uninstalling the application will automatically unregister it from C2DM.

Edit:

Oh, and about iOS - afaik it does not directly track uninstalled apps, it does however come with a failed notification feedback service that after a sequence of failed notifications (reported by the device to the push network) will notify you - allowing you to clean up after an uninstalled app.



回答2:

I cannot speak for iOS. You cannot get control when your application is uninstalled in Android.