【问题标题】:Objective-C/iPhone - oAuthException when using "me/checkins" as part of the Facebook Graph APIObjective-C/iPhone - 使用“me/checkins”作为 Facebook Graph API 的一部分时出现 oAuthException
【发布时间】:2011-08-23 05:27:38
【问题描述】:

使用 Facebook Graph API 将用户签入 Facebook 时,我收到以下图形响应。我在我的 iPhone 应用程序中使用facebook-ios-sdk 来执行此操作。

{"error":{"type":"OAuthException","message":"An unexpected error has occurred. Please retry your request later."}}

我今天没有对我的代码进行任何更改,并且我知道他们昨天已成功签入的事实(数据库日志等)。

我在问 SO 社区他们是否收到过类似的错误以及他们如何尝试解决这些错误?

我已经尝试了以下方法:

  1. 撤销了通过 Facebook 访问我的应用程序的权限。
  2. 通过强制 Facebook 生成一个新令牌来重置我的 offline_access。

请记住,我的应用程序也成功地通过人们的 Facebook 墙分享,并且按预期工作,没有任何问题。

我向我的用户请求以下权限:

@"offline_access", @"publish_stream", @"publish_checkins", @"email"

编辑:

好的,这很奇怪,我认为这是 Facebook 的错误。

我在签到时使用以下代码标记朋友:

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"];,那么签入对 me 来说效果很好。

每次我标记一个或多个朋友时它都会失败。在签到时标记朋友时是否有其他人收到相同的错误?

更新 1:

看起来其他人也遇到了与网上论坛相关的同样问题:

http://forum.developers.facebook.net/viewtopic.php?pid=349396

我想知道目前是否存在与 Checkins 相关的错误。

我发布了一个错误:

http://bugs.developers.facebook.net/show_bug.cgi?id=18134

更新 2:

Facebook 能够复制 the bug,他们现在正在调查它。

【问题讨论】:

    标签: iphone objective-c facebook facebook-graph-api


    【解决方案1】:

    我在我的一个应用程序中使用签入,关于您的问题,

    是的,你是对的,我有这个 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];
    

    希望这会有所帮助!

    【讨论】:

    • 由于某种原因添加“user_checkins”和“friends_checkins”已经完全解决了这个问题。我想知道 Facebook 是否已将这些作为先决权限添加以标记朋友,但忘记将它们添加到 graph.facebook.com 文档中?我正在等待他们通过 bugzilla 回复我,所以如果没问题,我不会接受答案,直到我听到 Facebook 自己的适当解决方案。感谢您的所有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多