使用Facebook C#SDK在Facebook页面上以管理员身份而不是页面发布 [英] Post On Facebook Page As Page Not As Admin User Using Facebook C# SDK
问题描述
我正在开发C#应用程序,该应用程序在使用Facebook C#SDK的Facebook上管理粉丝页面.我遇到了两个问题,一个与在墙上张贴消息有关,另一个与在粉丝页面上创建事件有关.
I'm developing C# application which manages fan page on Facebook which uses Facebook C# SDK. I've encountered two problems one is connected with posting messages on wall and the other concerns creating events on fan page.
是否可以将粉丝页面上的消息发布为粉丝页面而不是管理员用户?
Is it possible to post a message on fan page wall as a fan page not a admin user ?
我可以使用Facebook C#SDK以编程方式在粉丝页面(不是以管理员身份,而是粉丝页面)上创建事件吗?
Can I programmatically create event on fan page (not as admin but as a fan page) using Facebook C# SDK ?
我浏览了其他SDK的其他一些教程,例如Facebook PHP SDK. PHP SDK允许将事件创建为粉丝页面,但对于C#SDK,创建事件不会产生任何结果.
I went through some other tutorials of others SDKs such as Facebook PHP SDK. PHP SDK allows to create event as a fan page, but in case of C# SDK the creating event doesn't give any results.
推荐答案
要发布消息,您需要授予manages_pages权限,并使用"/me"的结果从粉丝专页"的帐户中获取访问令牌. /帐户".
For posting a message, you need to grant the manages_pages permission, and obtain an access token from the accounts for the Fan Page by using the results of "/me/accounts".
这是我用来将消息本身发布到粉丝页面的方法:
Here's what I use for posting a message itself to a Fan Page:
var dicParams = new Dictionary<string, object>();
dicParams["message"] = stSmContentTitle;
dicParams["caption"] = string.Empty;
dicParams["description"] = string.Empty;
dicParams["name"] = smContent.CmeUrl;
dicParams["req_perms"] = "publish_stream";
dicParams["scope"] = "publish_stream";
// Get the access token of the posting user if we need to
if (destinationID != this.FacebookAccount.UserAccountId)
{
dicParams["access_token"] = this.getPostingUserAuthToken(destinationID);
}
publishResponse = this.FacebookConnection.Post("/" + destinationID + "/feed", dicParams);
这篇关于使用Facebook C#SDK在Facebook页面上以管理员身份而不是页面发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!