-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(iOS)(Cordova) localStorage can get unexpectedly cleared when device storage is low #64
Comments
Any word on a fix for this? |
@pmramos two options PouchDB or LokiJS which have tutorials linked off from http://gonehybrid.com/dont-assume-localstorage-will-always-work-in-your-hybrid-app/ The preferred method looks like LokiJS with an unofficial filesystem adapter to persist the in-memory data. |
So switching to Sqlite or pouch or lokijs is the only option? Should i assume this will be not be fixed from apple/cordova? |
I am using pouchDB and get this issue only when the app is first install and the user "hard" close the app.. Anyone has solution to this issue? |
apple sucks... still no fix |
Any word on how it works with the new webview? |
@amritk We switched to WkWebView and experience still this problem. |
Does this apply also for IndexedDB?? |
what could be the problem? |
For everyone with this issue, use something like this: |
Yea we ended up switching to https://github.com/crypho/cordova-plugin-secure-storage |
Platforms:
Cordova apps on iOS, Safari on iOS
Summary:
localStorage might get cleared without user consent
How to reproduce:
localStorage
in your iOS Cordova appBackground
iOS5 introduced a feature where certain application data contents (non-permanent cached data) might get cleared if the device is running out of storage.
http://www.marco.org/2011/10/13/ios5-caches-cleaning
It seems the behavior also affects Cordova applications using localStorage. There are some reports in the internet about it and some of our internal testers reported the same issues on their iphones (on app built with Cordova 3.6).
http://forum.ionicframework.com/t/ios-localstorage-persistence/20004
http://forum.ionicframework.com/t/localstorage-is-it-cleared-after-app-restarts-periodically-in-ios/21819
Apparently the then-PhoneGap bug related to this was fixed long time ago, but it seems it reoccurs with new versions of iOS.
Related Android issues
There were also reports of bugs in Android 5 (Chrome 42) about last localStorage write being lost if the app is killed, but apparently the bug was quickly fixed
https://code.google.com/p/chromium/issues/detail?id=479767
The text was updated successfully, but these errors were encountered: