发布后的Facebook C#SDK不在墙上发布 [英] Facebook C# SDK after publishing not posting on wall

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

问题描述

我正在使用Facebook C#SDK实现朋友墙"上的帖子,我为本地主机和发布服务器制作了单独的FB应用程序,出现的问题是它在我的本地主机上运行正常,但是当我运行发布时该站点不是在墙上发布,而是在墙上成功显示(如果墙上发布成功,则显示消息)我正在正确提供AppID和AppSecret,这是我在朋友墙上发布的代码.

I am implementing Post on Wall of friend using Facebook C# SDK, i have made separate FB apps for my localhost and for publishing server, the problem is arising is that it is working fine on my localhost,but when i am running publishing site it is not posting on wall, but showing Posted on Wall successfully( The message i am showing if wall post is successfull) i am providing AppID and AppSecret properly Below is my code of posting on wall of friend.

var fbApplication = new DefaultFacebookApplication { AppId = fbapp, AppSecret = fbsec };
                var current = new FacebookWebContext(fbApplication);

                Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(fbtoken);                  
                dynamic parameters = new ExpandoObject();
                parameters.message = "";
                parameters.link = "Link to my Website";
                parameters.name = "Name";
                parameters.caption = "MyTitle";
                parameters.description = "Hello World";
                parameters.from = fromId;

            object resTest = client.Post("/" + friendId + "/feed", parameters);

推荐答案

您好,

我使用的是FacebookClient而不是FacebookWebClient,并且运行正常.
我正在Windows应用程序中使用它.

尝试使用类似这样的内容:
Hello,

I am using FacebookClient instead of FacebookWebClient and working perfectly.
I am using this in a windows application.

Try to use something like this:
var fb = new FacebookClient(_accessToken);
dynamic parameters = new ExpandoObject();

parameters.message = "Message";
fb.Post(me/feed, parameters);


希望您能找到解决方案.

编码愉快.


Hope you get the solution.

Happy coding.


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

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