0

I my application I want to get list of user friends. So am using bellow code.

            dynamic mw2 = client.Get("/me/friends",
                 new
                 {
                     access_token = accessToken
                 });

In response Data array comes as empty & count comes as 304 (which count of my friends).

I have also added permission "user_friends" while taking app permissions from user. But when I referred facebook guid it says that

"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."

As per this description I will not be able to get all friends list for my app. Is there any other way to get list of friends ?

vaibhav shah
  • 4,939
  • 19
  • 58
  • 96
  • possible duplicate of [Get ALL User Friends Using Facebook Graph API - Android](http://stackoverflow.com/questions/23850807/get-all-user-friends-using-facebook-graph-api-android) – andyrandy May 10 '15 at 21:54

3 Answers3

1

You said it yourself: "As per this description I will not be able to get all friends list for my app".

/me/friends will return an empty value (with a total count of your friends only) if none of your friends authorized your App. There is no way to get all friends anymore, except for tagging them or for inviting them to a game with canvas implementation.

All the information you need can be found in the answer of this thread: Get ALL User Friends Using Facebook Graph API - Android

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
0

I did same thing 3-4 months ago:

I tried using :

 var client = new FacebookClient(accessToken);
 dynamic FrndList = client.Get("/me/friends").ToString();

then you can use :

 foreach (var item in FrndList.data)

to iterate through each friend.

rovy
  • 2,481
  • 5
  • 18
  • 26
0

The permission read_friendlists no longer allows you to read the list of friends in a friendlist, but only lets you access the name of the list. This is useful for people building custom audience selectors when posting stories. All friends_* permissions have been removed.

In Graph API v2.0, access to /me/friends is no longer part of the default (public_profile) permissions. We now require you to ask for the new permission user_friends. With this permission, /me/friends now returns the person's friends who are also using the app.

Elad
  • 891
  • 5
  • 15