When the web is running on iPhone, localStorage is first set, but there may be occasional loss during retrieval. Because it is a native API of JS, the app cannot monitor it. How to configure wkwebview for consultation?
WKWebView: localStorage lost
Does this solve your problem?
https://codermite.com/t/experiencing-data-loss-with-localstorage-in-wkwebview-on-iphone-seeking-solutions/