我必须得到Facebook喜欢的特定页面,
我已经完成了
How to get Facebook likes count for a Facebook page?,但是在此之后,accesstoken将在某种程度上过期,并尝试重新生成如下所示的accesstoken:
public static string RefreshAccessToken(string currentAccessToken)
{
var client = new WebClient();
FacebookClient fbClient = new FacebookClient();
Dictionary<string, object> fbParams = new Dictionary<string, object>();
fbParams["client_id"] = "xxxxxxxxxxxxxxx";
fbParams["grant_type"] = "fb_exchange_token";
fbParams["client_secret"] = "xxxxxxxxxxxxxxx";
fbParams["fb_exchange_token"] = currentAccessToken;
JsonObject publishedResponse = fbClient.Get("/oauth/access_token", fbParams) as JsonObject;
string newaccesstoken = publishedResponse["access_token"].ToString();
return newaccesstoken;
}
它也失败了,你能不能告诉我如何在没有永不过期的访问权限的情况下获得计数?