I would like to execute a FQL to retrieve all app user's friends.
In previous versions of the sdk it could be done with:
var client = new FacebookWebClient();
client.Query(String.Format("SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = {0})", me.id));
but with the version 6.0.10 I have no clue how can I do the same.
Any ideas?
FQL
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql",
new { q = "SELECT uid FROM user WHERE uid=me()" });
FQL Multi Query
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql", new
{
q = new[]
{
"SELECT uid from user where uid=me()",
"SELECT name FROM user WHERE uid=me()"
}
});
FQL named multi-query
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("fql",
new
{
q = new
{
id = "SELECT uid from user where uid=me()",
name = "SELECT name FROM user WHERE uid " +
"IN (SELECT uid FROM #id)",
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With