bug: Storage does not hold it's value on app re-launches (iOS)
See original GitHub issueBug Report
Capacitor Version
npx cap doctor
output:
Latest Dependencies: @capacitor/cli: 1.3.0 @capacitor/core: 1.3.0 @capacitor/android: 1.3.0 @capacitor/ios: 1.3.0
Installed Dependencies: @capacitor/android 1.3.0 @capacitor/core 1.3.0 @capacitor/ios 1.3.0 @capacitor/cli 1.3.0
Affected Platform(s)
- Android
- [ x] iOS
- Electron
- Web
Current Behavior
I would expect the values to be present when re-launching the app, but storage is empty. Data does not persist across re-launches.
Expected Behavior
Would be able to access previously stored values on app re-launch.
Sample Code or Sample Application Repo
import { Plugins } from '@capacitor/core' const { Storage } = Plugins Storage.set({ key: 'aKey', value: JSON.stringify({...someObj}) })
Reproduction Steps
- Create a React component that saves user input into ‘Storage’ and display it on screen
- On iOS app re-launch, expect to see the previously stored data
Other Technical Details
npm --version
output: 6.12.0
node --version
output: v12.13.0
pod --version
output (iOS issues only): 1.8.4
Other Information
If this is the intended behaviour (Storage is ephemeral), would SQLite be the right go to choice? If I do not want to use a community plugin, are there any good examples on how to use SQLite with Capacitor directly?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
@wasimbakali, I’ve reopened the issue in case someone else has an answer.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.