开发者

Facebook API for iPhone Error: An active access token must be used

I am trying to retrieve my online friends and I am 开发者_Go百科getting this error:"An active access token must be used to query information about the current user."

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?


you are not waiting for the authorization to complete.

You will need to implement the didLogin delegate method, and

[facebook requestWithGraphPath:@"me/friends" andDelegate:self];

should go only after didLogin was called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜