Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list of all friends C# Facebook SDK v5 [closed]

Can you please give me the code for getting the list of all friends for a user?

Then How can I send an invitation to use my app, or send a comment to one of the friends?

Please don't tell me to look in the API, I want to learn how the C# SKD v5 should be used. Can anyone provide some code samples for this? Thanks

like image 746
Ryan Avatar asked Mar 10 '11 14:03

Ryan


People also ask

What is Friends full name?

(Matt LeBlanc ), Chandler Muriel Bing (Matthew Perry ), Ross Eustace Geller (David Schwimmer ) (this was only mentioned in a magazine article by one of the creators back in the 90's), and Monica E. Geller (Courteney Cox) (her middle name is never specified).


1 Answers

I am going to answer this one part at a time. the example I am writing uses dynamics so it requires .Net Framework 4.0 if using 3.5 this would need to be done with Dictionary.

the key to getting at your friends info is the Perm friends_about_me here is a list of all perms you can ask for. Facebook Permissions List

Can you please give me the code for getting the list of all friends for a user?

    var auth = new CanvasAuthorizer { Perms = "user_about_me,friends_about_me" };

    if (auth.Authorize())
    {
        var fb = new FacebookClient(auth.Session.AccessToken);
        dynamic myInfo = fb.Get("/me/friends");
        foreach (dynamic friend in myInfo.data  )
        {
            Response.Write("Name: " + friend.name + "<br/>Facebook id: " + friend.id + "<br/><br/>");
        }
    }
like image 195
JCPhlux Avatar answered Sep 20 '22 21:09

JCPhlux