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)
}
}
According to crashlytics crash is happening on line with info The challenge was not sent by the receiver.
challenge.sender?.useCredential(credential, forAuthenticationChallenge: challenge)
Any help is appreciated. This happens only on iOS 10.3. I guess some users have beta and are experiencing this.
Same problem for me, I fixed it by commented this line
// challenge.sender?.useCredential(credential, forAuthenticationChallenge: challenge)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With