如何使用Facebook C#SDK在Facebook页面上发布 [英] How can I use the Facebook C# SDK to post on Facebook Pages

查看:108
本文介绍了如何使用Facebook C#SDK在Facebook页面上发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经请求并获得了来自用户的manage_pages和publish_stream权限的访问权限。如何使用c#SDK获得发布到该用户的商业页面墙壁之一的权限(如果他们管理员多个页面,他们必须选择一个?)。一旦我有这样的访问权限,使用SDK发布到商业页面墙的最好方法是什么?

I have already requested and gained access to 'manage_pages' and 'publish_stream' permissions from a user. How can I use the c# SDK to get permission to post to one of that user's Business Pages wall (They must select one if they Admin multiple Pages, right?). Once I have that access, what is the best method to use the SDK to post to the Business Page wall?

在相关的注释中,C#SDK可以在ASP .NET 3.5有效? Rackspace Cloud Sites还没有在生产服务器上使用.NET 4.0,所以我需要看到不使用'dynamic'或'ExpandoObject'关键字的代码示例。

On a related note, can the C# SDK run under ASP.NET 3.5 effectively? Rackspace Cloud Sites is not allowing .NET 4.0 on production servers yet, so I need to see code examples that don't use the 'dynamic' or 'ExpandoObject' keywords.

谢谢!

推荐答案

以下是代码,如果它有助于您

following is the code if it helps you

FacebookApp fbApp = new FacebookApp();
FacebookApp app = new FacebookApp(fbApp.Session.AccessToken);
var args = new Dictionary<string, object>();
args["message"] = "abc";
args["caption"] = "This is caption!";
args["description"] = "This is description!";
args["name"] = "This is name!";
args["picture"] = "[your image URL]";
args["link"] = "[your link URL]";

app.Api("/me/feed", args, HttpMethod.Post);

您需要将app.Api的参数替换为特定的页面ID。
我不知道它是否正确的方式,但它适用于墙上的用户的帖子: - )

You need to replace /me in app.Api's arguments to the specific id of page. I'm not sure if its the right way, but it works for wall post of a user :-)

这篇关于如何使用Facebook C#SDK在Facebook页面上发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆