4

I wish to hit a web service, whenever a user deletes the app from his/her device. Its just to delete that user from Db. Can anybody here help me?? Thanks In Advance..

Nishant Tyagi
  • 9,893
  • 3
  • 40
  • 61
Sundeep Saluja
  • 1,089
  • 2
  • 14
  • 36
  • 1
    Refer the [link](http://stackoverflow.com/questions/8803181/how-to-catch-application-uninstalling-on-device-and-let-server-know-about-this) – LittleIDev May 09 '13 at 09:26

3 Answers3

3

Generally speaking, what you are attempting is probably not advisable. Even if it were possible to know when a user has deleted the app, how would you handle the situation where the user then re-installed the application and launched it? You also do not know why the user has deleted the app (perhaps they only wish to do so temporarily to free up space on their device? Perhaps their device was stolen and they are re-installing into a new, or upgraded device?)

If you separate your concerns (client has/does not have mobile app, vs client has/does not have active account) you can manage all these scenarios in a much more robust way.

Using an in-app analytics package (like Google Analytics, Parse or Flurry to name just a few) will give you insight as to your user behavior, and perhaps based on this usage data you can trigger handlers. For example, if you see a user has not used your app in a certain period you can email them or send a push notification to remind them? Perhaps you could email them to notify them "You have not logged in in 60 days, if you do not use your account within the next 30 days it will be deleted. Click here to re-activate your account."

cleverbit
  • 5,514
  • 5
  • 28
  • 38
0

No, can't do. There is no defined notification when an application is deleted. If you must talk to a server, suspend inactive accounts after a predefined time limit.

One other thing you can try is check for the UIApplicationWillTerminateNotification notification. Save the state of your app on your servers 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. Thats the iOS behavior till iOS 6.

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
-1

There is no way you could know whether the app is deleted from device or not because no delegate method fires when the app is deleted.

Hope it helps you.

likeitlikeit
  • 5,563
  • 5
  • 42
  • 56
Nishant Tyagi
  • 9,893
  • 3
  • 40
  • 61