How to remove local storage as app get uninstall


#1

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.


#2

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


#3

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


#4

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


#5

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

please try this method


#6

sorry didnt get your point


#7

@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…


#8

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


#9

this may be an issue related to your device


#10

Maybe your App reinit the localStorage when it restarts.


#11

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


#12

this is not the case…


#13

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.


#14

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).


#15

it happend to you :flushed: really


#16

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?


#17

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.


#18

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';

this.storage.set('createProfileLater', createProfileLater);

#19

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


#20

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?