0

I'm developing a Cordova app, when I restart the app in ios all localStorage and indexedDB are deleted. This phenomenon occurs intermittently, and once the issue is reproduced, it occurs continuously. I did a lot of searching on Google, but I couldn't figure out the exact cause. Please tell me what could be the cause of this phenomenon.

brad
  • 43
  • 2
  • 1
    https://stackoverflow.com/a/49156915/777265 – DaveAlden Jun 15 '23 at 07:25
  • Thank you for your link, but my device have enough storage. – brad Jun 15 '23 at 23:58
  • Still, if you switch to a native SQLite DB then your problem will go away. Any data stored in the Webview is considered temporary by the OS and liable to be wiped. – DaveAlden Jun 16 '23 at 09:55
  • You're right. But in my code localStorage is used in many places. So if i use db sqlite i have to change these code to async function. T.T – brad Jun 19 '23 at 04:50
  • The quota for localStorage on iOS is way smaller than Android. So even if your device has lots of storage you can only save around ~5MB. See https://stackoverflow.com/questions/1921048/limit-of-localstorage-on-iphone You should be able to save larger amounts of data in indexeddb bus as you say that is async as well. – Christiaan Jun 22 '23 at 07:36

0 Answers0