1

I'm using facebook sdk for c# and I have tried the code here :- you can see code in zip file

download code zip file

but problem in code is it is not retrieving friends list like i am using this line of code to get friends

dynamic me = fb.Get("me?fields=friends,name,email,favorite_athletes");

but it is not retrieving friends

Jaroslav Kadlec
  • 2,505
  • 4
  • 32
  • 43
steve
  • 11
  • 2
  • i have all code they provided my email,name ,id are retrieved but friends infor is not retrieved . make me sure facebook has not stopped to get friends names – steve Sep 15 '14 at 05:50

1 Answers1

2

There have been few changes in Graph API version 2.0 which might be reason behind this.

1.Facebook only returns friends who are using your app since Graph API 2.0 for apps which are created after 30 April 2014.

Check Facebook docs

/me/friends returns the user's friends who are also using your app

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.

So it means unlike 1.0 version you will not get list of all the friends that are on friendlist of user, instead you will get list of only those friends who have also authorized your app.

  1. You also need to ask for permission user_friends in Graph API V2.0 which was default in version 1.0

In v1.0 and earlier, the list of friends was available as part of the default permission set. To give people more control about the info they share with apps, we've separated the list of friends from the default. We have added a new permission so that you can ask for the list of friends. That permission is called user_friends. In order to use user_friends, you will need to add it to the list of scopes in your app when requesting permissions.

Most probably you are not receiving friends list because of one of the two reasons. Hope this helps

Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
  • can you suggest any link for doing so so that i can get friends list – steve Sep 15 '14 at 06:36
  • You can not get non app using friends in friends list any more , you can only get friends that are using (have authorized) your app. Thats the way facebook wants it to work. You might see some old apps using friends list feature , thats because facebook is providing support for those apps till April 2015, After that even those apps wont be able to get user friends . – Bhumit Mehta Sep 15 '14 at 06:40
  • Thanks to all this post will be good information for all about fb api – steve Sep 15 '14 at 14:46
  • Yes , Do accept the answer if you feel the information was helpful. – Bhumit Mehta Sep 15 '14 at 15:20