Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall ReactNative App - Clean User Data using Asyncstorage

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.

like image 409
krishna swaroopa I Avatar asked Apr 26 '17 05:04

krishna swaroopa I


People also ask

How do you clear all data from AsyncStorage in react native?

clear() ​ Erases all AsyncStorage for all clients, libraries, etc. You probably don't want to call this; use removeItem or multiRemove to clear only your app's keys.

How do I clear app data in react native?

If your data are stored at your app's folder or public folder, you can use react-native-fs to delete them.

What can I use instead of AsyncStorage in react native?

It store data in the form of a key-value pair. React Native recommended to use abstraction on top of AsyncStorage instead of AsyncStorage directly as it operates globally.


1 Answers

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.

like image 72
user2015762 Avatar answered Oct 14 '22 16:10

user2015762