在NSAllowsArbitraryLoads.The 9中,UIWebView没有加载(移动网页),有时是。我已经使用了ATS旁路,使用的是不总是发生的问题,并且在iOS 7和8中运行良好。调用了委托方法webViewDidStartLoad,但是webViewDidFinishLoad和didFailLoadWithError根本没有被调用。
发布于 2015-10-15 09:24:20
找到您需要做的solution.All是删除iOS 9中的UIWebView,并使用WKWebView.My网页对twitter、instagram等进行了一些第三方调用,这是https.Also在我的网页中遇到了Auth的挑战。(甚至我也禁用了ATS).I通过使用WKWebView找到了这一点,该WKWebView具有处理auth挑战的委托。
设置下面的委托以获取和处理该问题。
- (void)webView:(WKWebView *)webView
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
{
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
CFDataRef exceptions = SecTrustCopyExceptions(serverTrust);
SecTrustSetExceptions(serverTrust, exceptions);
CFRelease(exceptions);
completionHandler(NSURLSessionAuthChallengeUseCredential,
[NSURLCredential credentialForTrust:serverTrust]);
}https://stackoverflow.com/questions/32860125
复制相似问题