Facebook C# SDK - 将消息发布到用户墙

发布于 2024-10-31 14:41:52 字数 798 浏览 0 评论 0原文

使用最新的 beta 5.0.9,我以编程方式设置 appID 和 appSecret,并成功向用户墙/提要执行发布。这一切都很好。

然而,在 Facebook 上,已发布的消息始终“记入”(即 32 分钟前由 MyAppName)到 web.config 中包含的 appID,而不是到代码中设置的 appID。

显然,当我以编程方式设置 appID 时,我会假设这将用于“信用”发布。

这就是我初始化应用程序等的方式。

var fbApplication = new DefaultFacebookApplication { AppId = application.FBAppID, AppSecret = application.FBAppSecret };
                var current = new FacebookWebContext(fbApplication);

                Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(fbApplication);
                client.AccessToken = current.AccessToken;

调试应用程序我可以看到正确的 appID 和 appSecret 已设置。我在客户端上使用 POST 方法来执行发布到墙上的操作。

object resTest = client.Post("/me/feed", dataTest);

任何帮助/指导将不胜感激。

Using the latest beta 5.0.9, I am setting the appID and appSecret programatically and performing a post to users wall / feed successfully. This is all good.

However, on Facebook the message that has been posted is always "credited" (i.e. 32 minutes ago by MyAppName) to the appID that's contained in the web.config not to the appID that's been set in code.

Obviously as I am setting the appID programiatically I would assume that this would be used to "credit" to post.

This is how I'm initializing the app, etc

var fbApplication = new DefaultFacebookApplication { AppId = application.FBAppID, AppSecret = application.FBAppSecret };
                var current = new FacebookWebContext(fbApplication);

                Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(fbApplication);
                client.AccessToken = current.AccessToken;

Debugging the app I can see that the correct appID and appSecret have been set. I'm using the POST method on the client to perform the post to wall.

object resTest = client.Post("/me/feed", dataTest);

Any help / direction would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2024-11-07 14:41:52

根据 Post graph object 文档,有一个“from”字段。将发送者的 id 添加到 dataTest 对象,如下所示(假设 dataTest 是动态的):

dataTest.from = senderFacebookId;

According to the Post graph object documentation there is a "from" field. Add the sender's id to the dataTest object like so (assuming dataTest is dynamic):

dataTest.from = senderFacebookId;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文