FB C#SDK帮助要求发布到墙问题 [英] FB C# SDK help required Post to Wall Problem

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

问题描述


我正在使用FB C#SDK制作我的网站的邀请页面,我要求用户使用Facebook帐户登录,然后我要检索一个带有按钮的好友列表,以便将其张贴在每个好友的墙上

一切正常,但是如果任何朋友不允许在墙上张贴问题,就会出现问题

我该如何检查用户是否允许在其墙上张贴

Hi,
I am making invite page for my website using FB C# SDK, I am asking user to login with Facebook account and then i am retriving friends list with a button to post on wall on each friend

Everything is working fine, but the problem is arising when any friend doesn''t allow posting on his wall

How can I check for this that user has allowed to post on his wall or not

public JsonResult PostMessage(string friendid)
   {
       var fb = new FacebookOAuthClient { AppId , AppSecret  };
       dynamic result = fb.GetApplicationAccessToken();
       FacebookWebClient client = new FacebookWebClient();
       dynamic parameters = new ExpandoObject();
       parameters.message = "";
       parameters.link = "mysite url";
       parameters.name = "Name to display";
       parameters.caption = "Caption";
       parameters.description = "Description";
       parameters.from = InviteFriendsHelper.fbID;

       //this lines throws exception (OAuthException) (#210) User not visible
       client.Post(@"/" + friendid + "/feed", parameters);
       return Json(true);
   }


问候

推荐答案

您可能会从facebook开发者论坛获得更好的帮助. http://forum.developers.facebook.net/viewtopic.php?id=96780 [ ^ ]

作为一种变通的解决方法,您可以将该行包装在try-catch中,而忽略该问题. (尽管我不是一个认可的解决方案,但是还是一种解决方法.)
You may get better help from the facebook developers forum. http://forum.developers.facebook.net/viewtopic.php?id=96780[^]

As a hacky workaround, you could just wrap that line in a try-catch and just ignore the problem. (Not a solution I would endorse, but a workaround nonetheless.)


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

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