Facebook应用程序发布在朋友的墙上

时间:2010-12-07 11:06:48

标签: php facebook facebook-graph-api

如果这个问题有点重复早期问题,我很抱歉,但我没有找到任何相关答案。

我正在构建一个FB应用程序,我正在尝试使用以下代码发布到朋友墙:

$attachment = array(
'access_token' => $facebook->getAccessToken(),
'message' => 'Did a Test Post :',
'name' => "This is the title of my post",
'link' => "http://blogs.canalplan.org.uk/steve/2010/04/28/hitting-a-moving-target/",
'description' => "this is the body of the post with lots of wiffly woffly text in it, lets see if this all works ok!",
'picture'=>"http://blogs.canalplan.org.uk/steve/files/2009/12/13742_1291940983817_1389037839_836473_2130235_n.jpg",
);
100001893238650- this is a friend that give permission to publish on hes wall               
$facebook->api('/100001893238650/feed', 'POST', $attachment);  

现在,当我使用'我'而不是这个id时,它工作正常,但每当id不是'我'时,我得到Uncaught OAuthException:(#210)用户不可见错误。

我使用curl得到同样的错误。

我要求使用publish_stream并确保offline_access(我不认为offline_access已连接,但只是为了确定)权限。

我做错了什么?我需要更多的权限吗?

4 个答案:

答案 0 :(得分:3)

为了将来遇到这个问题的任何人的利益,请注意Facebook截至2013年2月禁止通过Graph API发布到朋友的墙上。

从此更改生效时开始查看他们的平台更新:http://developers.facebook.com/blog/post/2013/02/06/platform-updates--operation-developer-love/

答案 1 :(得分:1)

你有没看过这篇文章:How to publish Facebook feed as someone else other than the logged in user?

(稍有不同的问题,但同样的错误!)

答案 2 :(得分:1)

这可能是因为墙的主人使用了隐私设置,阻止其他用户发布到他/她的墙上。
这也可能是因为Facebook的错误。见http://bugs.developers.facebook.net/show_bug.cgi?id=11471

答案 3 :(得分:1)

去那个朋友的墙上,确保你能在他的墙上张贴。当facebook用户不允许你在他的墙上发帖时,会发生这种情况。你可以使用try catch来处理错误。