我正在使用facebook sdk api,在课堂上返回公开的facebook页面帖子。但它返回空白,不会引发错误。
var client = new FacebookClient();
dynamic result = client.Get("oauth/access_token", new
{
client_id = facebook_AppID, //App Id
client_secret = facebook_AppSecret, //App Secret
grant_type = "client_credentials" //client_credentials
});
var AccessToken = result.access_token;
var facebookClient = new FacebookClient(AccessToken);
JsonObject pagePost = facebookClient.Get("/thepagename/posts") as JsonObject;
string html = "";
foreach (var account in (JsonArray)pagePost["data"])
{
html += (string)(((JsonObject)account)["message"]);
}
我错过了什么?