I am trying to use an invisible WKWebView to run a (3rd party) javascript API that talks to a server over websockets. It works fine in the simulator, but will not establish a connection on iOS unless the WKWebView is in the view hierarchy. Possibly, I can live with that, but it makes me wonder whether this approach is too brittle. Is this behavior documented anywhere? What would be a better approach?
accessing network from headless WKWebView
Add a Comment