[xxx.HWebView webView:didReceive

2021-04-08  本文已影响0人  90后的晨仔

项目中使用了WebViewJavascriptBridge这个框架,导致崩溃。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Completion handler passed to -[xxx.HWebView webView:didReceiveAuthenticationChallenge:completionHandler:] was not called'

github上解决方案

(void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler
{
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
}
  func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
        completionHandler(URLSession.AuthChallengeDisposition.performDefaultHandling,nil)
    }
上一篇 下一篇

猜你喜欢

热点阅读