适用于 iPhone 的 Facebook API 错误:必须使用活动访问令牌 [英] Facebook API for iPhone Error: An active access token must be used
本文介绍了适用于 iPhone 的 Facebook API 错误:必须使用活动访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试检索我的在线朋友,但出现此错误:必须使用活动访问令牌来查询有关当前用户的信息."
I am trying to retrieve my online friends and I am getting this error:"An active access token must be used to query information about the current user."
这是我的方法:`-(IBAction)act:(id)sender{
This is my method:`-(IBAction)act:(id)sender{
NSArray* permissions = [[NSArray arrayWithObjects:
@"user_online_presence", @"friends_online_presence", nil] retain];
[facebook authorize:permissions delegate:self];
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
NSLog(@"dd");
NSLog(@"%@",facebook.accessToken);
}`我在这里做错了什么?
} ` What I am doing wrong here?
推荐答案
您无需等待授权完成.
您需要实现 didLogin 委托方法,并且
You will need to implement the didLogin delegate method, and
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
应该只在 didLogin 被调用后才去.
should go only after didLogin was called.
这篇关于适用于 iPhone 的 Facebook API 错误:必须使用活动访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文