ios - OAuthException/必须使用事件访问 token 来查询有关当前用户的信息

标签 ios facebook oauth token

尝试时:

facebook requestWithGraphPath:@"me/friends"

在我的 iOS 应用程序中出现错误

"OAuthException / An active access token must be used to query information about the current user"

我可以使用 requestWithGraphPath:@"me"成功查询我自己的 Facebook 数据,并且我可以使用我必须从中获取数据的 token

https://graph.facebook.com/me/friends?access_token=xxxx

在浏览器中。但它在 iOS 应用程序中不起作用...

有人可以帮忙吗?我尝试重新创建一个新的 Facebook 应用程序,因为我一直在从我批准的应用程序中删除我的初始测试应用程序,我认为这可能是导致它的原因,但结果是一样的。我在我的权限中请求“离线访问”,这样 token 就不会过期。

编辑:有趣的是,查询 FQL 用户表会返回我的好友列表 ID

最佳答案

虽然这是一个旧帖子,但我正在为关注者回答:

每当您使用 facebook graph API 发布内容时,您必须获得 atleat "publish_stream"的权限另外,当您收到授权时一定要发布到墙上,例如

if (![SharedFacebook isSessionValid])
 {
     NSArray *permissions = [[NSArray alloc] initWithObjects:@"offline_access", @"publish_stream", nil];
     [SharedFacebook authorize:permissions];///Show the login dialog

     /// [self postToWall];///Do not call it here b/c the permissions are not granted yet and you are posting to the wall.
  } 
else
 {        
    [self postToWall];
 }

关于ios - OAuthException/必须使用事件访问 token 来查询有关当前用户的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7531631/

相关文章:

facebook - 使用图表更改应用程序的选项卡名称

IOS - 未调用 Facebook SDK fbDidLogin - 初始化 View Controller 。

php - PHP Twitter API 中的“无法获取本地颁发者证书”

ios - 在 UITextView 中拆分段落并保存范围

ios - UIView.animate View 框架的问题

ios - UITableViewCell 计算出正确的高度,但 UILabel 不换行

ios - 尝试清理 iOS OAuth 代码

ios - UILabel:纯文本和属性文本有什么区别?

android - 在 android 4.0.3 中将消息发布到 facebook 墙时出错

facebook - 今天在 8 :21 推送后,dialog/oauth API 出现错误 500