我正在尝试使用 Facebook-SDK 版本 6.1.4 列出我所有朋友的生日当我使用下面的代码时(即没有 FQL,它运行良好,但我无法获得生日,只有名称和 id 值) .
var client = new FacebookClient(access_token);
dynamic me = client.Get(myusername);
client.IsSecureConnection = true;
friendListData = client.Get("/" + me.id + "/friends?fields=name,id");
JObject job = JObject.Parse(friendListData.ToString());
因此,我尝试将代码与 FQL 一起使用,但它会引发异常。
var client = new FacebookClient(access_token);
client.IsSecureConnection = true;
dynamic me = client.Get(myusername);
//var id = me.id;
Facebook.JsonObject friendListData = new Facebook.JsonObject();
try
{
friendListData = (Facebook.JsonObject)client.Get("fql",
new
{
q = new
{
name = "SELECT name, birthday, email, uid FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND birthday_date != 'null' ORDER BY birthday_date"
}
});
}
catch (FacebookOAuthException facebookAuth)
{
//"(OAuthException - #102) A user access token is required to request this resource."
}
我究竟做错了什么?