Uninstall ReactNative App - Clean User Data using Asyncstorage

时光怂恿深爱的人放手 提交于 2019-12-06 03:33:38

问题


I am using Async Storage to store some values in my react native app. I have a login so when I login into the app I am storing my id, when logout I am removing it.

But when uninstalling my app without logout then my data in async storage is not removing that refers to automatic login when installing the app again.

Can you please tell me how to solve this this happens in android device and version >6

Thank you.


回答1:


I've got the same issue and it simply seems to be the direct cause of android's new manifest keyword:

<android:allowBackup="true">

You can find more information on android documentation but quickly it says that app locally saved data might be backed up on Google Drive on the latest versions of Android. You can disable it either by setting <android:allowBackup="false"> (true is the default behavior) or by disabling auto backup in your phone's settings.




回答2:


Just wanted to add to user2015762's answer: if your build fails due to a conflict with the manifest of another package you're using, you may also need to add
tools:replace="android:allowBackup" to <application ...> and
xmlns:tools="http://schemas.android.com/tools" to <manifest ...>, like so:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="YOUR_APP_NAME">
...
<application
    android:allowBackup="false"
    tools:replace="android:allowBackup"
    ...>



来源:https://stackoverflow.com/questions/43625880/uninstall-reactnative-app-clean-user-data-using-asyncstorage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!