question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] AsyncStorage data persists after uninstalling and re-installing app

See original GitHub issue

Current behavior

Using the latest stable release (1.9.0), AsyncStorage items that are set persist after an iOS app is uninstalled and then re-installed.

Expected behavior

AsyncStorage should be completely clear after uninstalling/reinstalling an app. This is how the framework bundled AsyncStorage behaves, so one would expect the community version to function the same way. If this persistence is intentional, it should be documented (as far as I can tell there is nothing in the docs that would explain this behavior, but I might have missed something). Apologies if I am mistaken or if this issue has been reported already.

Repro steps

  1. AsyncStorage.setItem('someKey', 'someData');
  2. Uninstall iOS app
  3. Re-install iOS app
  4. const data = AsyncStorage.getItem('someKey'); // returns someData

Environment

  • Async Storage version: 1.9.0
  • React-Native version: 0.62.2
  • Platform tested: iOS 13.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
krizzucommented, Aug 28, 2020

Since we’re storing data in Application Support directory, it’s backed up by default.

We need a way to opt out from doing that. Going to work on that in upcoming days

2reactions
fbarthocommented, Oct 14, 2020

@Krizzu we’d be happy to try a beta build that has the final implementation of your proposed feature – I’ve commented on your PR for now with some further thoughts. This is affecting our app in production, so we’re comfortable testing an appropriate beta build in our normal QA process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is AsyncStorage still remain after update app to new codebase?
If the user does not uninstall the app and installs it again, the AsyncStorage will not be cleared. Taking into account that the...
Read more >
Is Storing data in LocalStorage is going to be removed if ...
Async storage stores data in the app space. This means that it will get removed when the app is uninstalled. If you want...
Read more >
iOS autodelete Keychain items afte… | Apple Developer Forums
I seem to recall that an app's keychain items would be deleted by iOS some X days/hours/minutes after an app is deleted, however...
Read more >
Clear all project state on the device | Voters - Expo - Canny
I looking for a way to clear a cache on published Expo app on iOS. ... you can do is completely uninstall the...
Read more >
Store key-value data on disk - Flutter documentation
Fortunately, the shared_preferences plugin can be used to persist key-value data on disk. The shared preferences plugin wraps NSUserDefaults on iOS and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found