0

I'm trying to get facebook user's friends list using the below code and user_friends,read_friendlists permissions but it does return zero friends.

var accesstoken = result.AccessToken;
                    //MessageBox.Show("token = " + accesstoken);
                    var client = new FacebookClient(accesstoken);
                    dynamic myInfo = client.Get("/me/friends");
                    StringBuilder buffer = new StringBuilder();

                    buffer.AppendLine();
                    foreach (dynamic friend in myInfo.data)
                    {
                        buffer.Append(friend.id);
                        buffer.Append(" = ");
                        buffer.Append(friend.name);
                        buffer.AppendLine();
                    }

                    MessageBox.Show("friends = " + buffer.ToString());

How do I fix this?

Jack
  • 16,276
  • 55
  • 159
  • 284
  • Are you getting response in myInfo? – Amit Jan 29 '15 at 05:25
  • You mean, if request is valid, ie, run without error? if so, yes. It's only empty. – Jack Jan 29 '15 at 05:29
  • Check this http://stackoverflow.com/questions/8584105/facebook-sdk-c-sharp-get-friends-list – Amit Jan 29 '15 at 05:31
  • @WizKid: How does this app works then? https://apps.facebook.com/friendlistexporter – Jack Jan 29 '15 at 05:33
  • 1
    Did you even read the post I linked to? In API v1.0 you can get all friends. In API v2.0 and later you can't – WizKid Jan 29 '15 at 05:47
  • I quickly read, sorry. But can I still get the Facebook C# SDK with API 1.0 around? I can't find it on official web site – Jack Jan 29 '15 at 06:01
  • If you don't have an v1.0 app you can't use it. And, v1.0 will only work until April 30th, 2015. – Tobi Jan 29 '15 at 08:36

0 Answers0