尝试时:
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/