In the latest release of ·Android System WebView (M42 42.0.2311.129)· there seems to be issues with localStorage in hybrid apps.
I've submitted a bug report but I am trying to find a workaround for objects not being persisted in localStorage.
This is taken from the bug report:
Steps to reproduce the problem:
1. Start hybrid app built with phonegap
2. In app, call javascript localStorage.setItem("m42bug","test for localstorage")
3. Through developer tools debugging confirm object has been stored: localStorage.getItem("m42bug")
4. Close app
(swipe it away, force close it or restarting the device all cause the same)
5. Start app
6. In app, call javascript localStorage.getItem("m42bug")
What is the expected behavior?
localStorage.getItem("m42bug")
should return the value "test for localstorage"
What went wrong?
localStorage.getItem("m42bug")
returns null.
Object.keys(localStorage)
indicate there is no key for m42bug
Faced the exact same problem. For a workaround we store the localstorage data on the phone on exit from the app and restore it from there on app start. Works fine :) Hope it helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With