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上。我猜一些用戶已經測試並正在遇到這種情況。
沒有任何一個得到解決的問題?我面臨同樣的問題。請幫助 –