简体   繁体   中英

Getting friends of friends with Facebook iOS SDK

Is it possible to get information about friends of my friends using facebook ios sdk? Please.If it is possible give an example.

request with Graph api @'[friend_id]/friends " does not work.

'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. 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 *facebookObject = [[Facebook alloc] init];

  • Check permissions

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

  • Authorize 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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