2017-02-21 115 views
4
func webView(webView: WKWebView, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { 
    var user: String? 
    var password: String? 
    switch providerID { 
    case "197": // ABC Stagging 
     user = "ABC" 
     password = "abc" 
    default: 
     break 
    } 
    if let user = user, password = password { 
     let credential = NSURLCredential(user: user, password: password, persistence: NSURLCredentialPersistence.ForSession) 
     challenge.sender?.useCredential(credential, forAuthenticationChallenge: challenge) 
     completionHandler(NSURLSessionAuthChallengeDisposition.UseCredential, credential) 
    } 
} 

根據crashlytics崩潰正在發生信息線挑戰不是由接收器發送。WKWebView iOS 10.3崩潰的didReceiveAuthenticationChallenge?

challenge.sender?.useCredential(credential, forAuthenticationChallenge: challenge) 

任何幫助表示讚賞。這隻發生在iOS 10.3上。我猜一些用戶已經測試並正在遇到這種情況。

+0

沒有任何一個得到解決的問題?我面臨同樣的問題。請幫助 –

回答

1

我同樣的問題,我的評論這條線固定它

// challenge.sender?.useCredential(credential, forAuthenticationChallenge: challenge) 
+0

是的,這也是我所做的。 –

+0

我們應該可以設置憑據 – iDev

+0

是否有人解決了問題?我面臨同樣的問題。請幫忙。評論該行並沒有幫助 –