Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall ReactNative App - Clean User Data

Tags:

react-native

I want to clean the User AuthData Saved in Mobile upon uninstall. AuthData is saved using AsyncStorage. Is there any mechanism by which I can detect App Uninstall in ReactNative

like image 457
Ankit Babbar Avatar asked Apr 24 '16 08:04

Ankit Babbar


People also ask

How do I clear app data in react native?

' Additionally, you can press Option+Shift+Command+K. To clean the Android studio cache, open the Android Studio menu and click 'Tools,' then 'AVD Manager,' and select the menu in your emulator and select 'wipe data.

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

React native asyncstorage provide removeItem() method to remove stored value from asyncstorage, it will delete stored key value paired data in asyncstorage.


1 Answers

Doesn't seem possible, especially if your app is not running at the time they uninstall. However, there seems to be a couple approaches you can take, but neither is perfect.

  1. If your app is running, you can listen for UIApplicationWillTerminateNotification (see Detect iOS application about to delete?)
  2. Use the push notification feedback service (see Delegate Method when Deleting App)
like image 144
Chris Geirman Avatar answered Oct 11 '22 15:10

Chris Geirman