0

I am getting total count in the response, but the data is empty. Can anyone help me with this.

Leon Storey
  • 3,274
  • 2
  • 25
  • 40
  • Perhaps this will help: http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u – Robert J. Clegg Jan 20 '17 at 12:07

1 Answers1

0

You can retrieve a list of the user's friends after requesting the user_friends permission and running the below code, this will return the uid of each friend.

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

To fetch friends on a specific friends list you will need to request the permission read_custom_friendlists and run the below code with the friendw list id returned from the /{user-id}/friendlists edge

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{friend-list-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Leon Storey
  • 3,274
  • 2
  • 25
  • 40