1

I am using Facebook SDK 4.20 to get all friends. Currently I am using below code to get the same:

if ([FBSDKAccessToken currentAccessToken]) {
        [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/friends" parameters:@{@"fields": @"name,id,uid,list_type"}] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
            if (!error) {
                NSLog(@"User Profile is : %@",result);
            }
        }];
    }

Using above code I am getting a list of only those friends who are currently using my app. I have a total of 458 friends in my friends list but using above code I am getting only 2 friends from the list who are currently using/registered with my app using Facebook.

Can anyone help me where I am going wrong? What else I can do to get all 458 friends?

I know the questions related to this is already asked on Stack Overflow but none of those are about Facebook SDK V4.20 or not related to getting all friends. The respected questions are may be about old SDKs or about getting list of the friends who are using their app.

halfer
  • 18,701
  • 13
  • 79
  • 158
Er. Vihar
  • 1,335
  • 1
  • 11
  • 27
  • 2
    You are not doing anything wrong. You just need to read the documentation. /me/friends just return app friends. There is no way to get all friends – WizKid Mar 20 '17 at 05:54
  • it does not matter which sdk you are using, the api is the same. check out the duplicate question. – luschn Mar 20 '17 at 07:45
  • @luschn I think you have not read hole question. I have mention in my question that please not that "I donn't expect duplicate mark. Only relevant answer." And I have mentioned SDK specific question because I have gone through developer.facebook.com, where I found some changes mentioned based on SDK versions. I hope you reply again after considering hole issue. – Er. Vihar Mar 20 '17 at 10:24
  • please read my comment. if you found some changes mentioned based on sdk versions, please point me to those. in general, it does not matter which sdk you are using, the api version is important and there is no way to get all friends anymore as you can read in that duplicate thread. make sure you understand the difference between "sdk" and "api". – luschn Mar 20 '17 at 10:36
  • @luschn I am not saying you are not right. And Thank you to point me out that the SDK version don't matter. I just comment you regarding you must not mark my question as duplicate. Let it go.. Its okay. Thank you for your humble reply. – Er. Vihar Mar 20 '17 at 10:39
  • why not? it is a duplicate and the answer in that other thread is still valid and very detailed. – luschn Mar 20 '17 at 11:54

1 Answers1

4

It is not possible with Graph Api

me/friends

returns friends who already use your app.

me/taggable_friends

returns friends that can be tagged in content published.

me/invitable_friends

This edge is only available to Games (including Gameroom), and requires the user_friends permission. its return a inevitable friends for game

More Info Here and Here

Harshal Valanda
  • 4,911
  • 24
  • 61