问题
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 addtools:replace="android:allowBackup"
to <application ...>
andxmlns: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