How to get facebook friend list??
I'm working on a project and i need the project that, those who will login by facebook then facebook friend list will show and the user can invite to his friend to join website.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Manoj BhoirRank #599 · 4K reputationPosted Jun 20, 2015, 6:45 AM EDT
Your function for storing friends list from json data:
string myAccessToken = "something";
FacebookClient client = new FacebookClient(myAccessToken);
var friendListData = client.Get("/me/friends");
JObject friendListJson = JObject.Parse(friendListData.ToString());
List
foreach (var friend in friendListJson["data"].Children())
{
FbUser fbUser = new FbUser();
fbUser.Id = friend["id"].ToString().Replace("\"", "");
fbUser.Name = friend["name"].ToString().Replace("\"", "");
fbUsers.Add(fbUser);
}
Class for facebook user
Class FbUser {
String Id { set; get; }
String Name { set; get; }
}