Facebook C#SDK示例将发布到群组墙 [英] Facebook C# SDK Sample to Post To Group Wall

查看:65
本文介绍了Facebook C#SDK示例将发布到群组墙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请提供一个示例,说明如何使用在此位置找到的C#Facebook SDK发布到群组墙上 https://github.com/facebook-csharp-sdk/facebook-csharp-sdk .以下是几行相关代码.创建fb客户端,填写参数(未显示),并进行fb.post调用.为了尝试张贴到群组墙上,我所做的就是将我/提要"更改为"groupId/提要".我可能会找出问题所在,但Facebook错误没有提供任何信息.返回的错误是(OAuthException)发生意外错误.请稍后重试您的请求."

Please give a sample of how to post to a group wall using the C# Facebook SDK found at this location https://github.com/facebook-csharp-sdk/facebook-csharp-sdk . Below is just a few lines of relevant code. An fb client is created, parameters filled in (not shown), and a fb.post call is made. For my attempt to post to a group wall, all I did was change the "me/feed" to "groupId/feed". I could probably figure out what is wrong but the Facebook error provides no information. The error returned is "(OAuthException) An unexpected error has occurred. Please retry your request later."

var fb =新的FacebookWebClient();

var fb = new FacebookWebClient();

原始SDK示例代码为:dynamic id = fb.Post("me/feed",parameters);

Original SDK Sample Code is: dynamic id = fb.Post("me/feed", parameters);

试图发布到群组的信息是:动态id = fb.Post("328271290556233/feed",参数);

Attempt to Post to Group is: dynamic id = fb.Post("328271290556233/feed", parameters);

不幸的是,我并没有使用上面提到的SDK来找到示例.

Unfortunately I have not been unable to find an example using the SDK referenced above.

谢谢您的帮助.

推荐答案

尝试了多次尝试后,我通过尝试使用

After trying multiple attempts, I figured out the problem by trying to post a message to my group using the Facebook Explorer app at http://developers.facebook.com/tools/explorer . It did post and I realized I had granted the application all rights. I then removed all rights and added back one by one. Here is what is interesting, if you are missing the publish_stream right, then a post attempt results in a useful error message stating the application does not have the right to post. If your application has publish_stream but not user_groups, then you get the unknown error. So, to fix my problem all I had to do was have my application ask for the user_groups right. The exact rights I use are user_about_me,user_groups,publish_stream,manage_pages. I hate I missed something so obvious but a helpful error message would have been nice. To post to a group using the SDK just replace "me" with the group id. That is it.

这篇关于Facebook C#SDK示例将发布到群组墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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