0

In my application I have an option to get all Facebook friends. So I want to my all Facebook friends. But enable to get all friend. I am using API version v2.4 and when I was check API in Facebook graph explore its give me response like this:

Graph API : v2.4/me?fields=friends

Response :

{
      "friends": {
        "data": [
        ],
        "summary": {
          "total_count": 200
        }
      },
      "id": "1700734103483027"
}

Total count is right, but list is not showing. Graph API gives debug message like this "Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.Learn More".

So how can I get all Facebook friends?

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Monika Patel
  • 2,287
  • 3
  • 20
  • 45

1 Answers1

1

Facebook changed the permissions. You can not get all Facebook friend.

You can only get the friends which are using your application.

From the Facebook documents :

https://developers.facebook.com/docs/facebook-login/permissions/v2.4

user_friends

Provides access the list of friends that also use your app. These friends can be found on the friends edge on the user object.

In order for a person to show up in one person's friend list, both people must have decided to share their list of friends with your app and not disabled that permission during login. Also both friends must have been asked for user_friends during the login process. Review

Your app may use this permission without review from Facebook. Common Usage

Use the list of friends to create a social experience in your app.

Also described in the

read_custom_friendlists

Provides access to the names of custom lists a person has created to organize their friends. This is useful for rendering an audience selector when someone is publishing stories to Facebook from your app.

This permission does not give access to a list of person's friends. If you want to access a person's friends who also use your app, you should use the user_friends permission.

This permission will also not help you invite a person's friends to use your app. To learn more about how to invite friends to an app, please see our FAQs.

This permission also does not give the list of friends who are part of a friendlist. It only gives access to the names of the lists.

This permission was called read_friendlists before v2.3

Ashish Kakkad
  • 23,586
  • 12
  • 103
  • 136