开发者

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

开发者 https://www.devze.com 2023-03-08 07:56 出处:网络
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.\"

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

精彩评论

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