0

I am using way mentioned below to find friend list but it is not working. And earlier methods i used (FBRequestConnection) is not working any more may be they are not supported any more. Please guide.

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me/friends" parameters:@{@"fields": @"name"} HTTPMethod:@"GET"];
                 [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
                     // TODO: handle results or error of request.
                     NSLog(@"request friend list:%@", request);
                 }];

Respsonse i got from this is:

request friend list:<FBSDKGraphRequest: 0x7fc77af33bc0, graphPath: /me/friendlists, HTTPMethod: GET, parameters: {
"access_token" = CAAIDdxjgZCZAQBAIupnz8fToFBh4YzgdvTAVciQZAZBj1kX8h7iZCYc1WSqVBVmmiCKRuAbymzRVcQeLZAIhhssc6JkB50rsOFJK6KwsuEiK6B1jvPuaUNZAIm2YqlZCg1INs9ZCoyqOo6lmRjjkttxX2RrkWZAUEDxE8lP9DApbyDh5ZChbsPT5zZAsdRMj3tQkVxLXyLaMXxN9rbPxU8lZCs57HbhOQXmkZD;
fields = name;
format = json;
"include_headers" = false;
sdk = ios;
}>
iPhone 7
  • 1,731
  • 1
  • 27
  • 63

1 Answers1

0

First of all need to pass the permission parameter "user_friends" at the time of login.Then use the below code to get list.

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/friends" parameters:@{@"fields": @"name"} HTTPMethod:@"GET"];
                 [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
                     // TODO: handle results or error of request.
                     NSLog(@"request friend list:%@", result);
                 }];
iPhone 7
  • 1,731
  • 1
  • 27
  • 63