Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect iOS application about to delete?

Tags:

ios

iphone

For my iOS application, what event will be triggered when user a is about to delete the application?

like image 734
Water7 Avatar asked Aug 02 '11 11:08

Water7


People also ask

Is it possible to detect iOS app uninstall?

You can detect app uninstalls by sending 'silent' push notifications. Silent push notifications are those notifications that aren't rendered on the user's device. You could send a silent push notification daily to all the devices with your app to track uninstalls.

Can companies tell when you delete an app?

Those notifications normally conduct processes such as refreshing an application while it is running in the background. When the app doesn't respond, the developer notes that it has been uninstalled. The company can then use that information for advertising purposes.


1 Answers

No such thing, sorry.

The best you can do is do is check for the UIApplicationWillTerminateNotification notification but more importantly save the state of your app (on a server for example) when it's transitioning to the background and cross your fingers your user will not delete your app when it's not running. Because once your app closed, you don't have any control anymore.

EDIT: Since you want to clear the keychain's content when the app is deleted, I suggest you take a look at this other question. Basically, what is suggested by some answers there is not to remove the content of the keychain at delete time, but instead when the user first launches the app using NSUserDefaults.

EDIT: Luis Ascorbe commented with an idea: using Push Notification's feedback service ( https://stackoverflow.com/a/7912045/157401 ) Of course, that's far from perfect (not all users subscribe to the notifications, notification tokens might be invalidated for other reasons, etc.) but that's still something to consider.

EDIT: Starting with iOS 10.3 Beta 2, keychain data appears to no longer be persisted when an app is deleted.

like image 198
Remy Vanherweghem Avatar answered Oct 08 '22 18:10

Remy Vanherweghem