Facebook 身份验证错误 - 操作无法完成
我的游戏中有一个选项,可供用户将成就发布到他们的墙上。如果他们已登录,即他们的令牌仍然有效,那么它就可以正常工作。但是,如果他们需要更新令牌,应用程序将退出,Facebook 身份验证页面会加载一秒钟,然后返回应用程序(如果他们主动注销,则只需在身份验证页面上单击“确定”,否则会自动发生) 。
问题是,如果发生这种情况,当游戏返回时,请求会失败。但由于他们现在已经登录,如果他们再次按下“分享到墙上”按钮,效果就很好。失败的请求输出的错误消息:
DIDLOGIN
2012-02-21 12:01:33.502[18153:15803] Response received
2012-02-21 12:01:33.502[18153:15803] Request did load raw response
2012-02-21 12:01:33.502[18153:15803] Request failed, error: Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x9992010 {error=<CFBasicHash 0x99785e0 [0x2093b38]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0x9963370 [0x2093b38]>{contents = "type"} = <CFString 0x99952a0 [0x2093b38]>{contents = "OAuthException"}
3 : <CFString 0x99631e0 [0x2093b38]>{contents = "message"} = <CFString 0x997e5b0 [0x2093b38]>{contents = "An active access token must be used to query information about the current user."}
6 : <CFString 0x998c370 [0x2093b38]>{contents = "code"} = 2500
}
}
我不确定为什么在我刚刚成功授权时会收到 OAuthException?
感谢您的帮助!
I have an option in my game for users to post an achievement to their wall. If they are logged in, i.e. their token is still active, it works fine. However, if they need to renew their token, the app exits and the Facebook authentication page loads for a second before returning to the app (they only need to click OK on the authentication page if they have actively logged out, otherwise it happens automatically).
The problem is that if this happens, when the game returns, the request fails. But since they're now logged in, if they were to press the 'share to wall' button a second time, it works fine. The error message output by the failed request it:
DIDLOGIN
2012-02-21 12:01:33.502[18153:15803] Response received
2012-02-21 12:01:33.502[18153:15803] Request did load raw response
2012-02-21 12:01:33.502[18153:15803] Request failed, error: Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x9992010 {error=<CFBasicHash 0x99785e0 [0x2093b38]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0x9963370 [0x2093b38]>{contents = "type"} = <CFString 0x99952a0 [0x2093b38]>{contents = "OAuthException"}
3 : <CFString 0x99631e0 [0x2093b38]>{contents = "message"} = <CFString 0x997e5b0 [0x2093b38]>{contents = "An active access token must be used to query information about the current user."}
6 : <CFString 0x998c370 [0x2093b38]>{contents = "code"} = 2500
}
}
I'm not sure why I'm getting an OAuthException when I've just successfully authorised it?
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您设置参数字典并将其发送到 facebook 时..也传递访问令牌,就像这样
when you set the dictionary of params that you send it to the facebook .. pass the acces token also ,, like this
嗯,我发现了问题。至少我认为我找到了它,因为它现在可以工作了,我只是希望我没有在这个过程中引入另一个错误。基本上我的登录编码如下:
fbDidLogin 是用户登录时调用的委托方法。
[facebook requestWithGraphPath:@"me" andDelegate:self]; 行是问题所在。我将其移至 fbDidLogin 方法的末尾,现在它似乎工作正常。
Well, I found the problem. At least I think I found it, as it now works, I just hope I didn't introduce another error in the process. Basically my login coded looked like this:
fbDidLogin is a delegate method called when the user has logged in. The line
[facebook requestWithGraphPath:@"me" andDelegate:self];
was the problem. I moved it to the end of the fbDidLogin method and now it seems to work perfectly.