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.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manoj BhoirPosted Jun 20, 2015, 10:45 AM
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; }
}