加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

从Twitter.sharedInstance()获取错误Swift 3 iOS 10

发布时间:2020-12-14 05:25:49 所属栏目:百科 来源:网络整理
导读:我在iOS 10上使用 Swift 3编写应用程序.当用户拒绝来自系统或帐户的帐户权限时,sharedInstance()方法会向控制台抛出错误(例如“无法使用系统帐户进行??身份验证”).在进入关闭之前,控制台上会显示错误.我不会在应用中向用户显示此错误,例如在警报.这是我的代
我在iOS 10上使用 Swift 3编写应用程序.当用户拒绝来自系统或帐户的帐户权限时,sharedInstance()方法会向控制台抛出错误(例如“无法使用系统帐户进行??身份验证”).在进入关闭之前,控制台上会显示错误.我不会在应用中向用户显示此错误,例如在警报.这是我的代码:
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>
}

我希望向用户显示:“无法使用系统帐户进行??身份验证.用户允许系统帐户权限,但没有设置.”

我面临的问题与问题相同.
我刚刚将callBack Url设置为Twitter应用程序并解决了问题.

转到https://apps.twitter.com/app – >设置 – >要保存的回调URL和更新设置.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读