WKWebView unable to load custom URL scheme with HTTPS

Hello, I would like to load local resources (images and JSON) in a WKWebView by defining a custom URL scheme and using WKURLSchemeHandler. I have a WKWebView that loads web content that will do an HTTP GET request on the URL scheme, which the WKWebView catches and returns an HTTP response along with the resource (in JSON) via my handler.

This setup works when the website uses http, but fails when using https with the following error:


[blocked] The page at [web page with https] was not allowed to display insecure content from [custom url scheme].


I observed the error using Safari's development tool for viewing the loaded web content in a WKWebView.

Safari seems to be blocking mixed content when a webpage is served over https. Is there a way to resolve this issue?

Post not yet marked as solved Up vote post of jjky Down vote post of jjky
2.1k views

Replies

Hello, I have same question, Did you resolve it?

The same problem, how to fix it?