Parv Bhasker Parv Bhasker -4 years ago 70
iOS Question

has facebook again allowed to fetch friendlist of a user?

On recent research facebook provide this new method to fetch frendslist.

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{user-id}/friendlists"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];



me?fields=id,name,friendlists


But it is returning empty data element.
is there any other way or somthing

Answer Source

do like

Initially you need to pass the permission parameter user_friends at the time of login.

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/friends" parameters:@{@"fields": @"name",@"id",@"picture"} HTTPMethod:@"GET"];
                 [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {

                     NSLog(@"request friend list:%@", result);
                 }];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download