How to remove local storage as app get uninstall

I am using ionic framework for building Hybrid Mobile application.

I have make an app (for cross platform) on it and it is using angular local storage but the problem is

if some one uninstall the app the local storage data is not Removing.

how can i remove local storage’s specific data as app get uninstalled.

1 Like

As I know… uninstall app in ios and android will remove all localStorage associated with the app…

1 Like

no man . i have checked after app un install, local storage variable remain same

1 Like

just for my clarification…
the storage accessed(local to device) by user or the storage inaccessible(internal / isolated) by user

Before Uninstall App, goto settings, apps, tap on your app, tap on clear data, clear cache, remove your app.

please try this method

1 Like

sorry didnt get your point

@muhammadFaizanKhan there are two type of storage
1st is internal storage, which can not be accessed by anyother app or user. this wont be visible to you also. This storage is the one that will get deleted automatically when u remove the app… best used for apps internal settings.

2nd is external storage, which will be accessible by other apps or the users… example downloaded documents/ images files etc. this the programmer has to decide and write code to remove on app uninstall…

i used angular local storage (categorize it as internal storage i guess). but when the app uninstall and install again local storage didnt remove\delete. i have checked plenty of time

this may be an issue related to your device

Maybe your App reinit the localStorage when it restarts.

no i have checked on different devices. did u ever checked this scenario???

this is not the case…

Hmm. Odd one. I use localStorage for a few apps and I’ve never come across this. Uninstalling wipes the localStorage for me.

This must be an angular local storage issue as it certainly isn’t one for vanilla localStorage.

Interestingly enough, my local storage doesn’t always get wiped either!

Running iPhone 6 Plus, iOS (versions 8-8.3 beta 3) it sometimes will and sometimes it won’t. I haven’t been able to pin point exactly what causes it to. It might be something with building through Xcode, or something when installing/uninstalling/overwritting with TestFlight.

I could dig through some of the iOS docs later and see if I can find any information specifically for it. But @muhammadFaizanKhan isn’t crazy, its happened to me too. (And I’ve been developing for 2+ years with mobile hybrid frameworks).

1 Like

it happend to you :flushed: really

Hi, I have a similar issue here.
I am developing an ionic app with cordova file plugin, in this app, user can download files(images,audios,text…) from server then store it in the external storage (ex, for android, “externalRootDirectory/appName”).
And I prefer these files can be removed when uninstalling the app.
Anyone have an idea?

I am having same problem. Reinstalling the app brings back localstorage values and actually they are old values. The app that was uninstalled had different values, so localstorage remembers some values and uses them each time I install the app.

1 Like

I have this too that my internal storage is not removed when I deleted the app.
I tested this on Android.

I make use of:

import { Storage } from '@ionic/storage';'createProfileLater', createProfileLater);

Wait… are you saying that we could make a virus app that continues even after the app is installed? Interesting… Muahahahah…

I have same issue. I convert my app because of this from localstorage to sqllite db. Still have same problem…

I delete files from Settings/Applications/myApp. Then uninstall it, then install it again…This works.
But If I forgot to delete cache files from settings and uninstall then install my app again, my app sees same db again :frowning:

too strange…Removing app does not delete sqllite db and localstorage variables… Any hint?