我正在与夫特3在iOS 10. sharedInstance()
方法引发错误,当用户拒绝权限从系统或帐户以考虑不配置(例如到控制台“无法写入应用获取错误使用系统帐户进行身份验证“)。错误在进入关闭之前在控制台上显示。我不会在应用中向用户显示此错误警惕。这是我的代码:从Twitter.sharedInstance()夫特3的iOS 10
Twitter.sharedInstance().logIn { (session, error) in
if error != nil {
// print(error?.localizedDescription ?? " ")
return
})
我得到这个错误:
2016-11-29 14:49:09.023 CarReview[1254:31719] [TwitterKit] did encounter error with message "Unable to authenticate using the system account.": Error Domain=TWTRLogInErrorDomain Code=2 "User allowed permission to system accounts but there were none set up." UserInfo={NSLocalizedDescription=User allowed permission to system accounts but there were none set up.}
2016-11-29 14:49:09.024 CarReview[1254:31719] [TwitterKit] No matching scheme found.
2016-11-29 14:49:09.292 CarReview[1254:31719] [TwitterKit] did encounter error with message "Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
" UserInfo={NSLocalizedDescription=<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
}
我想向用户展示这一点:“无法使用系统帐户验证用户允许的权限系统帐户,但什么都没有设置向上。”
是不是我的意思。在关闭呼叫之前在控制台上显示错误,我对此没有影响。我不会向用户显示这个错误。控制台上的错误显示了它自己。 –
如果你不希望它在控制台关闭前被印刷出来,您需要在我的答案添加DispatchQueue.main.async等。 –
尽管我没有控制错误,但是控制台出错了,但它不是我的打印功能。 –