I am trying to load a webpage that is under a local network after the device connects to a specific WiFi.
I am getting this error:
WebPageProxy::didFailProvisionalLoadForFrame: frameID = 3, domain = NSURLErrorDomain, code = -1202
I can load any other webpage I try with no issues.
I can pull up the webpage on Safari in the xcode simulator and I am able to see it, but I do get the "This Connection is Not Private" page before and have to click the "visit this website" button. Not sure if this is the problem.
In addition to allow arbitrary load in Info you may need to implement this function in your WKNavigationDelegate
func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
guard let serverTrust = challenge.protectionSpace.serverTrust else {
completionHandler(.useCredential, nil)
return
}
let credential = URLCredential(trust: serverTrust)
completionHandler(.useCredential, credential)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With