0
我想簡單地使用C#控制檯應用程序連接到Facebook圖表,但我有FacebookOAuth異常。這是我到目前爲止的代碼:Facebook API登錄C#桌面應用程序
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();
異常來自哪裏? –
@JamieKeeling我的歉意。錯誤來自動態結果= client.Get(「/ oauth/access_token」...) –
@JamieKeeling具體來說,它說我的redirect_uri無效。我應該爲基於桌面的應用使用什麼redirect_uri? –