我知道这个问题被问了很多,但我似乎无法做到这一点。我很想发布到我的Facebook群组。我一直得到(#200)用户没有授权应用程序执行此操作错误。我使用的是.NET 4.5和Facebook SDK 6.4.2。感谢。
dynamic messagePost = new ExpandoObject();
messagePost.picture = "http://www.yaplex.com/logos/yaplex-logo-with-text-small.png";
messagePost.link = "http://yaplex.com/";
messagePost.name = "[name] Facebook name...";
messagePost.caption = " Facebook caption";
messagePost.description = "[description] Facebook description...";
messagePost.message = "[message] Facebook message...";
const string acccessToken = "xxxx";
var appp = new FacebookClient(acccessToken);
try
{
appp.Post("xxxxx" + "/feed", messagePost);
}
catch (FacebookOAuthException ex)
{
//handle oauth exception
}
catch (FacebookApiException ex)
{
//handle facebook exception
}
答案 0 :(得分:0)
如果要发布到用户的Feed,则需要确保收集了相应访问令牌的“publish_actions”权限。
请参阅此处的文档:
https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish