Facebook graph api SDK php,在公共墙中添加新闻

Facebook graph api SDK php,在公共墙中添加新闻,facebook-graph-api,facebook-php-sdk,facebook-page,Facebook Graph Api,Facebook Php Sdk,Facebook Page,我试着在我的墙上(为每个人)发布新闻,但我的程序不起作用,你能帮我吗 $app_config = array( 'appId' => 'xxxxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxx', 'cookie' => true ); $page_config = arra

我试着在我的墙上(为每个人)发布新闻,但我的程序不起作用,你能帮我吗

            $app_config = array(
                'appId' => 'xxxxxxxxxxxxxxxx',
                'secret' => 'xxxxxxxxxxxxxxx',
                'cookie' => true
            );
            $page_config = array(
                'access_token' => 'xxxxxxxxxxxxxxxxxxxxxxxxx',
                'page_id' => 'xxxxxxxxxxxxxxxxxxxxx'
            );


            $facebook = new Facebook($app_config);


            $privacy=array('value' => 'EVERYONE');
            $decri=array('name' => 'See the link', 'link' => 'http://www.xxxxxx.com');
            $description="this is a test";
            $picture="a.png";

            $params = array(
             'access_token' => $page_config['access_token'],
             'name' => $title,
             'caption' => 'www.xxxxxx.com',
             'link' => 'http://www.xxxxxx.com',
             'description' => $description,
             'picture' => $picture,
             'status_type' => 'mobile_status_update',
             'type' => 'status',
             'privacy' => json_encode($privacy),
             'actions' => json_encode($decri)
            );

            $post_id = $facebook->api('/'.$page_config['page_id'].'/feed','post',$params);
但是什么都没有发表,我不明白
非常感谢您

通过您的代码,我假设您正在Facebook页面上发布信息,在本例中,尤其是一个链接

当您尝试发布链接时,您不会将它们发布到
/PAGE\u ID/feed
,而是将它们发布到
/PAGE\u ID/links
(请参阅)

在您的示例中,您的API请求应该如下所示:

$post_id = $facebook->api('/'.$page_config['page_id'].'/links','post',$params);
另外,
$picture
应该是一个链接,以
http
https
开头

最后但并非最不重要的一点是,确保您拥有
发布流
管理页面
权限

与文档相比,您使用的参数略有不同,因此请仔细检查-似乎您做了太多的工作