1

我可以访问 facebook 用户信息,但我想显示用户的所有朋友列表。

facebook的请求代码是

string clientId = "xxxxxxxxxxxxx";

        string redirectUrl = "http://localhost:4727/facebook.aspx";



        Response.Redirect(string.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}", clientId, redirectUrl));

我使用一些代码来获取

        if (Request.QueryString["code"] != null)
        {
            string token = GetAccessToken();
            string url = "https://graph.facebook.com/me?fields=id,email,first_name,last_name,gender,locale,link,username,timezone,location&access_token=" + token;
            //string url = "https://graph.facebook.com/me/friends?fields=id,name,picture,link&access_token=" + token;
            JObject myProfile = JObject.Parse(requestFBData(url));
            string myID = myProfile["id"].ToString().Replace("\"", "");
            string myName = myProfile["name"].ToString().Replace("\"", "");
            //string email = myProfile["email"].ToString().Replace("\"", "");

            Label1.Text = myID;
            Label2.Text = myName;
            Label3.Text = "Welcome to fb.somee.com  ";
            Image1.ImageUrl = "https://graph.facebook.com/me/picture?type=large&access_token=" + token;

        }

我还需要做什么??

4

0 回答 0