Facebook C# SDK - 将消息发布到用户墙
使用最新的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 Post graph object 文档,有一个“from”字段。将发送者的 id 添加到 dataTest 对象,如下所示(假设 dataTest 是动态的):
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):