我在使用 Facebook Graph API 将用户 checkin Facebook 时收到以下图表响应。我正在使用 facebook-ios-sdk在我的 iPhone 应用程序中执行此操作。
{"error":{"type":"OAuthException","message":"An unexpected error has occurred. Please retry your request later."}}
我今天没有对我的代码进行任何更改,我知道一个事实(数据库日志等)他们昨天已经成功 checkin 。
我想问 SO 社区他们是否收到过类似的错误以及他们是如何尝试解决这些错误的?
我已经尝试过以下方法:
- 撤销了通过 Facebook 访问我的应用程序的权限。
- 通过强制 Facebook 生成一个新 token 来重置我的
offline_access
token 。
请记住,我的应用程序也通过人们的 Facebook 墙成功分享,这按预期工作,没有任何问题。
我向我的用户请求以下权限:
@"offline_access", @"publish_stream", @"publish_checkins", @"email"
编辑:
好吧,这很奇怪,我认为这是 Facebook 端的一个错误。
我使用以下代码在签到中标记 friend :
if ([self.selectedFriends count] > 0) {
[variables setObject:[self.selectedFriends componentsJoinedByString:@","] forKey:@"tags"];
}
fb_graph_response = [fbGraph doGraphPost:@"me/checkins" withPostVars:variables clientId:accessToken];
self.selectedFriends
只是 Facebook 个人资料 ID 的一个 NSMutableArray
,用逗号分隔,这就是图形 API 所说的使用方式,记住这几个月来一直运行良好.
http://developers.facebook.com/docs/reference/api/checkin/
如果我删除 [variables setObject:[self.selectedFriends componentsJoinedByString:@","] forKey:@"tags"];
然后 checkin 工作对我来说就很好.
每次标记一个或多个 friend 时都失败。在签到时标记 friend 时,是否有其他人收到同样的错误?
更新 1:
看起来其他人也遇到了与群组相关的相同问题:
http://forum.developers.facebook.net/viewtopic.php?pid=349396
我想知道目前是否存在与签到相关的错误。
我发布了一个错误:
http://bugs.developers.facebook.net/show_bug.cgi?id=18134
更新 2:
Facebook 能够重现 the bug他们现在正在调查。
最佳答案
我正在我的一个应用程序中使用 checkin ,关于您的问题,
是的,你是对的,只有当你有时不断地与标记 friend 签到时,我才会有这个 OAUTH 异常,
在你的应用程序中也允许像@"user_checkins", @"friends_checkins"这样的权限
请检查此链接:
http://tylerwhitedesign.com/how-to-check-in-using-the-facebook-ios-sdk-and-graph-api
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[dictionary objectForKey:@"place"], @"place", //The PlaceID
coordinates, @"coordinates", // The latitude and longitude in string format (JSON)
message, @"message", // The status message
tags, @"tags", // The user's friends who are being checked in
nil];
[_facebook requestWithGraphPath:@"me/checkins" andParams:params andHttpMethod:@"POST" andDelegate: postCheckinRequestResult];
希望这对您有所帮助!
关于iphone - Objective-C/iPhone - 使用 "me/checkins"作为 Facebook Graph API 的一部分时出现 oAuthException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6213262/