iOS 15 Beta Safari/WKWebView WebPage not loading shows blank screen

In iOS 15 beta 8, Safari/WKWebView is not loading some of the web pages it displays the blank white screen.

Is anyone facing the same problem in Safari browser or WKWebview? How to solve this issue, Please help me to move forward on this!!!

Replies

We are also experiencing problems with WKWebView on iOS 15. That happens only, if we compile the app with Xcode 13 and run it on iOS 15 devices. Compiling with Xcode 12 all runs well on the same iOS 15 device (well, what we can call "well" in a WebApp...) Did you find a solution meanwhile?

  • We were able to solve the problem with:

    let configuration = WKWebViewConfiguration() let contentController = WKUserContentController() let script = WKUserScript( source: #"window._platformProperties = {"os":"ios","capabilities":["brightness","contactInformation","location","push","share","storage","userRating"]}"#, injectionTime: .atDocumentStart, forMainFrameOnly: true ) contentController.addUserScript(script) configuration.userContentController = contentController let webView = WKWebView(frame: .zero, configuration: configuration) ...more code

    It was tricky to tackle, as in previous versions it worked when we called evaluateJavaScript() at any time. With the changes in Xcode 13 / iOS 15 we tried calling it after webview.load(_ urlRequest: URLRequest), that still was to early. We tried calling evaluateJavascript() in: webView(_ webView: WKWebView, didFinish navigation: WKNavigation?) That was too late. The webview requires our "window._platformProperties" to be present in order to load. Only after using a WKUserScript it works, as it is executed just at the right time.

Add a Comment