LocalStorage not being cleared on app uninstall -

2019-04-27 02:44发布

i'm having a problem where the localstorage doesn't get cleared when i uninstall the app (ionic app). It's only happening on my Samsung S7 Edge with Android 6 (at least is the only device with Android 6 that i have).

The only way of clearing it is by Clearing Data/Cache through the Application Manager of the device...

It works properly on other devices... Since the localstorage implementation is pretty straightforward I have no clue why this is happenning...

Any ideas?

2条回答
做自己的国王
2楼-- · 2019-04-27 03:32

Android 6 has automatic backup on.

Did you try setting android:allowBackup="false" and android:fullBackupContent="false" in your manifest.xml?

android:allowBackup and android:fullBackupContent are properties of <application/> in application's manifest.xml.

In ionic 2, you can find this under platforms folder also. You can use these properties in case, if you don't want your data backed up or if you want to include or exclude some resources.

I also struggled with it for a long time on Lenovo Vibe phone. This solved it.

查看更多
Root(大扎)
3楼-- · 2019-04-27 03:33

I had problems adding those lines to my AndroidManifest.xml in my cordova /progject/platforms/android folder - each time I did it was overwritten every time I compiled the app. I had to add the following to my /project/config.xml file in order to get the manifest edits to take:

<edit-config file="AndroidManifest.xml"
             target="/manifest/application"
             mode="merge">
    <application android:allowBackup="false"/>
    <application android:fullBackupContent="false"/>
</edit-config>
查看更多
登录 后发表回答