为iPhone错误的Facebook API:必须使用激活的访问令牌 [英] Facebook API for iPhone Error: An active access token must be used

查看:127
本文介绍了为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为)行为:(ID)发送{

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.

您将需要实现didLogin委托方法,以及

You will need to implement the didLogin delegate method, and

[Facebook的requestWithGraphPath:@我/朋友andDelegate:个体经营];

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

应该去didLogin被称为之后。

should go only after didLogin was called.

这篇关于为iPhone错误的Facebook API:必须使用激活的访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆