Access local storage in iOS apps

I serve remote html / javascript content in an iPad app. The javascript code works fine and the html rendering is fine, but any attempt to access localStorage throws "Security_err: dom exception 18".

I tried to use localStorage because Safari does not accept third-party cookies by default. Is there a way to set cookies or store values ​​in localStorage from remote content to maintain state when serving an iOS application?

+3
source share
1 answer

I know this question is old (and gathering dust), but here is the answer.

18 .

:

  • html, [myWebView loadHTMLString:str baseURL:url]; webview [myWebView loadRequest:someNSURLRequest];

  • , Cordova.plist, ExternalHosts * (, ).

0

Source: https://habr.com/ru/post/1779065/


All Articles