stefy97100
stefy97100

Reputation: 41

Facebook friends list is empty

My friends count result is 0, why?

var client = new FacebookClient(accessToken);

dynamic me = client.Get("me");
string firstName = me.first_name;
string lastName = me.last_name;
MessageBox.Show(firstName);

dynamic friendListData = client.Get("/me/friends");

var result = (from i in (IEnumerable<dynamic>)friendListData.data
              select new
              {
                  i.name,
                  i.id
              }).ToArray();

ArrayList array = new ArrayList(result);

MessageBox.Show(array.Count.ToString());

Upvotes: 0

Views: 608

Answers (1)

user268911
user268911

Reputation:

If this is an app created after April 30, 2014 the only friends you will see are other friends who also use the app.

First, which version of the Graph API can you use?

For apps created on or after April 30th 2014, making API calls without specifying a version number is equivalent to calling v2.0 of the API. These apps won't be able to call v1.0 of the API.

And how does API version affect the friends list?

Graph API v2.0 includes some changes to how user IDs and friends work in order to better protect people's info... In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.

You can read it all here: https://developers.facebook.com/docs/apps/upgrading

Upvotes: 1

Related Questions