I have a problem with localStorage on an ionic app on iphone.
on android it seems to work ok.
on iphone the localstorage just expires after awhile.
I've tried with
$localStorage.test
using angular ngStorage.js.
and with:
window.localStorage.test
same results.
anyone experienced this? any solution?
Thanks.
Rafi.
Asked
Active
Viewed 778 times
3

Rafi
- 33
- 5
-
First [check](https://stackoverflow.com/questions/16427636/check-if-localstorage-is-available) LS supported or not. – Jaydeep Mor Jun 20 '17 at 09:53
1 Answers
1
If there is low internal memory on iPhone, iOS automatically delete some caches and localstorage.
LocalStorage works well if there is sufficient memory on the device(usually more than 20mb at least)
So better to use sqlite instead of localstorage :)

Jameel Grand
- 2,294
- 16
- 32
-
FYI the `WebSql` spec which was based on `sqlite` is deprecated and should not be used [w3c Spec](https://www.w3.org/TR/webdatabase/). I would advise indexedDB instead. Quote "`The specification reached an impasse: all interested implementors have used the same SQL backend (Sqlite), but we need multiple independent implementations to proceed along a standardisation path.`" – ste2425 Jun 20 '17 at 10:22