I have used ionic storage in my app. Also, I store token in storage while authenticating. But when I uninstall the app, the ionic stoarge is not getting deleted, and when I install it again the app is logged in with the previous user x, I experiencing this issue in some devices (Nexus, Redmi Note 3), whereas some other devices are not able to replicate this issue such as moto e.
Please suggest how to forcefully clear the ionic stoarge on uninstalling the app.
For Clearing Ionic Storage data of your app Programmatic I hope you tried Clear Method for Ionic Storage.
But to clear Applicationās data in the device while uninstalling, you need to clear application data from the settings option in the whichever device you are using
In your device go to Settings >Apps >YourApp and hit the button Clear Data in order to clear data while uninstalling your Application.
Yes, I do have logout method where I have used storage.clear() method. but while uninstalling it wonāt be called(assuming user unistall app without logout the app), so that the data from the storage is not cleared.
Manually data clear is not a solution, I need something that I will handle in code.
What you are experiencing is not not deleted data, but automatically restored data on reinstall of your app. iOS and Android started to back up local storage data to their cloud services a few versions ago.
What did you set it to? I have my BackupWebStorage set to none and it still seems to be getting backup in the cloud for Android. What version of Ionic and Cordova were you using?