0

FaceBook launched new API from version 2.0 and asking users to upgrade to new SDK.
In my iOS application (which is not a game), user signs in using Facebook. In side the application I have an option to show all the FB friends of the user (friends who are not using the application).

I tried the below code which returns the friends who are using the application:

[FBRequestConnection startWithGraphPath:@"/me/friends"
                                 parameters:nil
                                 HTTPMethod:@"GET"
                          completionHandler:^(
                                              FBRequestConnection *connection,
                                              id result,
                                              NSError *error
                                              ) {
                              /* handle the result */
                              NSLog(@"%@", result);
                          }];

And below code is not working in my application, because my app is not a game. As per FB, below code works only for Games.

FBRequest *request =  [FBRequest  requestWithGraphPath:@"me/invitable_friends"
                                                parameters:@{@"fields":@"name,installed,first_name"}
                                                HTTPMethod:@"GET"];

    [request startWithCompletionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error){


        NSLog(@"%@", result);
    }];

Is there any other alternative to fetch the friends of the user?

Satyam
  • 14,636
  • 29
  • 122
  • 234
  • nope, there is no way. invitable_friends is only for games and only for inviting users, and taggable_friends is only for tagging users. – luschn Aug 25 '14 at 18:12

1 Answers1

0

According to the document, with the new Facebook Graph API 2.0, there is no way to fetch all friends.

Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app

Phat H. VU
  • 2,324
  • 1
  • 19
  • 30
  • FBFriendPickerViewController available as part of iOS SDK is able to display all the friends of the logged in user. I don't know how FB is allowing it and stopped "me/Friends" to return all the friends list. – Satyam Aug 27 '14 at 16:43