我有一个应用程序,它使用"http://maps.google.com“URL打开URL视图中两个位置之间的方向。但它并不适用于iOS12。还启用了值中的例外域。即使它不起作用。
发布于 2018-10-30 06:05:37
对我来说,这个问题是由来自WKWebView的服务器信任检查引起的。
要解决这个问题,我必须处理挑战身份验证回调,并返回服务器信任凭据。
Swift 4
func webView(_ webView: WKWebView,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
{
if(challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust)
{
let cred = URLCredential(trust: challenge.protectionSpace.serverTrust!)
completionHandler(.useCredential, cred)
}
else
{
completionHandler(.performDefaultHandling, nil)
}
}发布于 2018-10-22 12:03:39
https://stackoverflow.com/questions/52928827
复制相似问题