简体   繁体   English

通过Facebook iOS SDK结识朋友

[英]Getting friends of friends with Facebook iOS SDK

Is it possible to get information about friends of my friends using facebook ios sdk? 是否可以使用facebook ios sdk获取有关我朋友的朋友的信息? Please.If it is possible give an example. 请。如果有可能,请举一个例子。

request with Graph api @'[friend_id]/friends " does not work. Graph api @'[friend_id]/friends “的请求不起作用。

'code' [facebook requestWithGraphPath:@"[friend_id]/friends" andDelegate:self];'code'
 i try this code but it returns
 Error:facebookErrDomain error 10000 where'code'
 facebook = [[ Facebook alloc] initWithAppId:app_id]; 
NSArray *permissions = [NSArray arrayWithObjects:@"I try all permissions"];
 [facebook authorize:permissions delegate:self]; 'code' 

user is logged in, All information about this friend is available 用户登录,有关此朋友的所有信息均可用

I'm quite sure this is not possible, you'ld need data access privs of the friends to get their friends data. 我非常确定这是不可能的,您需要朋友的数据访问权限才能获取他们的朋友数据。 this has to do with the access rights on fb and this is good for some reasons it is like it is. 这与fb上的访问权限有关,这出于某些原因是有好处的。 even if this data protection mechanism disturbs your business idea ;) 即使此数据保护机制干扰了您的经营理念;)

If you want catch friend informations you must : 如果您想获取朋友信息,则必须:

  • Alloc and Init a Facebook object 分配和初始化Facebook对象

Facebook *facebookObject = [[Facebook alloc] init];

  • Check permissions 检查权限

NSArray *permissions = [NSArray arrayWithObjects:@"publish_stream", @"offline_access",nil];

  • Authorize facebook 授权facebook

[facebookObject authorize:APP_ID permissions:permissions delegate:self];

  • After that you can used 之后,您可以使用

[facebookObject requestWithGraphPath:@"me/friend" andDelegate:self];

  • In delegate methods 在委托方法中

- (void)request:(FBRequest *)request didLoad:(id)result

You catch the result who must be a NSDictionnary. 您得到的结果必须是NSDictionnary。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM