-
Notifications
You must be signed in to change notification settings - Fork 478
Closed
Labels
platform: iOSThis is iOS specificThis is iOS specific
Description
Current behavior
Async Storage does not persist between app reloads
Expected behavior
expect the storage to persist between app reloads
Repro steps
Theory: It may be due to my environment. I am on RN 0.60.3 but link async-storage manually instead of relying on the auto-linking mechanic. Could this cause an issue?
Steps to reproduce:
-
store items in storage
await AsyncStorage.setItem('someItem', JSON.stringify(someItem));
-
retrieve items to ensure they have been stored
let keys = [];
try {
keys = await AsyncStorage.getAllKeys();
} catch (e) {
console.log('e', e);
// read key error
}
console.log(keys);
- reload application & look for keys
let keys = [];
try {
keys = await AsyncStorage.getAllKeys();
} catch (e) {
console.log('e', e);
// read key error
}
console.log(keys);
- The previously stored keys are no longer present.
Environment
do not use podfile, instead link react-native manually
"@react-native-community/async-storage": "^1.6.1"
"react-native": "0.60.3"
- occurs on both iOS and android
crobinson42, omerts, YaduS, yolpsoftware, iliapnmrv and 1 more
Metadata
Metadata
Assignees
Labels
platform: iOSThis is iOS specificThis is iOS specific