1

From what I've read here, here, here and elsewhere, there's no way to catch when my app is being uninstalled. Some of the questions and answers are quite old...

How do I know then if I can remove related content from my mySQL db if it is no longer relevant?

Content created by user with phone number 123456789 is stored online in my mySQL database. If the user uninstalls the app,then the data in mySQL database should be removed as it is no longer of any use and just taking up space and causing confusion.

CHarris
  • 2,693
  • 8
  • 45
  • 71
  • @Selvin Yes I read that question from 2013, was hoping there might be a solution since then. – CHarris Apr 11 '19 at 14:10
  • Nothing changes, still the answer is: your app will not get any event on its deletion – Selvin Apr 11 '19 at 14:10
  • 4
    Uninstalls should be independent of your server content. For example, if the user factory-resets their device, or their device gets broken, they will not be uninstalling your app, yet they will not be using that app instance anymore. Conversely, if they use your app across multiple devices, they may want to be sharing that content between those devices, and so an uninstall on one device does not mean the content should be removed. – CommonsWare Apr 11 '19 at 14:10

1 Answers1

1

A possible solution would be to track the last time a user used your app in your db and clean any table records user that did not use your app for X amount of time. You can also warn the user before data deletion with a notification (of course it will only work for user that still did not uninstall your app).

LiefLayer
  • 977
  • 1
  • 12
  • 29
  • @Basi there is no need to warn a user that deleted the app (he want to delete data from user that uninstalled the app). He just need to warn user that still have the app installed but did not use it for X-1 amount of time. After X amount it will delete the app data even if installed. – LiefLayer Apr 11 '19 at 14:13