我正在尝试使用 C# 控制台应用程序简单地连接到 Facebook Graph,但遇到了 FacebookOAuth 异常。到目前为止,这是我的代码:
var client = new FacebookClient();
// Exchange the code for an access token
dynamic result = client.Get("/oauth/access_token", new
{
client_id = "****************",
client_secret = "*****************************",
redirect_uri = "http://www.teamdavix.com",
});
// Read the auth values
string accessToken = result.access_token;
DateTime expires = DateTime.UtcNow.AddSeconds(Convert.ToDouble(result.expires));
var query = "SELECT author_uid, page_id, message FROM checkin WHERE page_id = 357981198572";
dynamic parameters = new ExpandoObject();
parameters.q = query;
dynamic results = client.Get("/fql", parameters);
Console.WriteLine(results);
Console.ReadKey();