我收到以下錯誤信息:獲取(OAuthException - #2500)有效的訪問令牌必須用於查詢當前用戶
(OAuthException - #2500) An active access token must be used to query information about the current user.
在C#中使用Facebook SDK的V6。
下面是代碼,我使用了,請注意,我遺漏了我的AppID和App揭祕:
public partial class Form1 : Form
{
private string accessToken;
private void getAccessTokenButton_Click(object sender, EventArgs e)
{
FacebookClient client = new FacebookClient();
dynamic result = client.Get("oauth/access_token", new
{
client_id = "OMITTED",
client_secret = "OMITTED",
grant_type = "client_credentials"
});
accessToken = result.access_token;
}
private void retrieveFirstNameButton_Click(object sender, EventArgs e)
{
FacebookClient client = new FacebookClient();
client.AccessToken = accessToken;
dynamic result = client.Get("me");
MessageBox.Show(result.first_name);
}
}
可能重複(http://facebook.stackoverflow.com/questions/9351241/need-help-on-oauthexception-代碼2500) – Igy 2013-02-11 05:12:52