gpt4 book ai didi

ios - WKWebView iOS 10.3 因 didReceiveAuthenticationChallenge 崩溃?

转载 作者:可可西里 更新时间:2023-11-01 04:45:04 25 4
gpt4 key购买 nike

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 的说法,崩溃是在线发生的,信息挑战不是由接收者发送的。

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

感谢任何帮助。这仅发生在 iOS 10.3 上。我猜有些用户有测试版并且正在体验这种情况。

最佳答案

同样的问题,我通过评论这一行来解决

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

关于ios - WKWebView iOS 10.3 因 didReceiveAuthenticationChallenge 崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42374960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com