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.

bug: Storage does not hold it's value on app re-launches (iOS)

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jbonigomescommented, Feb 2, 2021

@wasimbakali, I’ve reopened the issue in case someone else has an answer.

0reactions
ionitron-bot[bot]commented, Nov 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Local storage data getting deleted… | Apple Developer Forums
The data will retain only when the app is in active state. But the stored key itself is deleted once we kill or...
Read more >
How To Fix iPhone Storage Always Loading (Not Showing Up)
2. Force Quit Settings · Open the App Switcher (swipe-up from the bottom of the screen or double-click the Home button on older...
Read more >
Some Users Plagued by Incorrect 'iPhone Storage Almost Full ...
Other reports on Twitter indicate that iOS 15 has resulted in a bug in which the amount of available storage on a device...
Read more >
iPhone Other and System Data: How to get rid of it - Macworld
To see how much storage all your apps and data are taking up on your iPhone's storage, open the Settings app, select General,...
Read more >
Core Data not saving objects persistently - ios - Stack Overflow
Maybe the object did in fact save, but the method in which you're verifying that they have in fact been saved is wrong....
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