I have to get Facebook likes for a particular page,
I have gone through
How to get Facebook likes count for a Facebook page?, but following this, accesstoken will be expired by some sort of time and also tried to regenerate the accesstoken as below:
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;
}
it was also failed, can you please tell me how to get likes count only without never expire accesstoken?