I am testing my app on multiple phones. When the app is installed the app walks the user through some basic registrations and app initialization - then some of that info is written to localstorage. The app install process looks for specific variables/files and if they don't exist or are not set it assumes a new install.
when the app is uninstalled all that local storage/files content is supposed to be wiped out. This is the case on all but one of the devices I am testing on.
MotoX works
Samsung Galaxy S5 works
iPhone 6 & 7 work
LG K20 Plus does not work.
After uninstalling the app from the phone (1: long click on app and move to trash can (asks to uninstall), 2: then I go into Settings -> Apps and still see the app listed there - I then delete it from there.) the localstorage data is still there.
When I reinstall the app on that LG device it somehow is still seeing all the local storage content and files and thus bypasses the app initialization and registration. That content isn't actually getting deleted when the app is fully uninstalled from the phone.
I am not certain how to manage this and makes me wonder how much this is happening on different phone types. Why isn't app uninstall fully removing the app; why is it leaving some stuff in localstorage?
Is there a way for an app to know its being uninstalled and have it remove/delete that extra content? Is there a mechanism in the app to let the "uninstaller" fully remove all contents related to the app?