我正在尝试通过在我的应用中使用 twitter 来获取用户的详细联系信息.我在 github 上找到了 this 项目,这看起来非常好.我只遇到一个问题.如果我使用来自 twitter 的新应用程序消费者密钥和消费者密钥代码运行它,它会给我一个错误:
I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error :
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=api.twitter/oauth/request_token, NSErrorFailingURLStringKey=api.twitter/oauth/request_token, NSUnderlyingError=0x68980e0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}控制台的输出是:
2013-01-16 17:55:24.367 DMTwitterOAuth[3411:c07] current status = Prompt for user data and request token to server 2013-01-16 17:55:24.371 DMTwitterOAuth[3411:c07] current status = Requesting token for current user's auth data... 2013-01-16 17:55:25.433 DMTwitterOAuth[3411:c07] current status = Token received from server在我收到警报视图后立即显示它遇到了 NSURLErrorDomain.
Immediately after I get the alert view in which it says that it encountered a NSURLErrorDomain.
另一方面,如果我使用来自另一个 twitter 应用程序的其他代码运行它,它会工作,为我提供有关用户的所有详细信息.我只是不明白为什么对于某些键它有效,而对于其他一些键则不起作用.
On the other hand, if I run it with some other codes from another twitter app it works, giving me all the details about the user. I just can't understand why for some keys it works, and for some others it doesn't.
推荐答案错误代码 -1012 是 kCFURLErrorUserCancelledAuthentication.这应该意味着某些代码在某处称为 [sender cancelAuthenticationChallenge:] 以响应身份验证质询.这可能是 DMTwitterOAuth 中的代码,但也可能是 Apple 在 URL 加载系统中自己的代码.
Error code -1012 is kCFURLErrorUserCancelledAuthentication. This should mean that some code somewhere called [sender cancelAuthenticationChallenge:] in response to an authentication challenge. This is likely code inside of DMTwitterOAuth, but it's also possible it's Apple's own code inside the URL-loading system.
更多推荐
iOS Twitter NSURLErrorDomain 代码=
发布评论