开发者

How to send message to news feed with facebook sdk php

I would like to send message to news feed of user, i'm doing it with the code bellow but it does not go to news feed, it only go to user page.

<?php
require "src/facebook.php";

$facebook = new Facebook(array(
'appId'=>'xxx',
'secret'=&开发者_如何转开发gt;'xxx',
'cookie'=>true
));

$usuario = $facebook->getUser();

if(!$usuario)
{
    $login_url = $facebook->getLoginUrl(array('scope'=>'email,publish_stream'));
    echo "<script> document.location=\"".$login_url."\"; </script>";
}


$facebook->api('/me/feed','POST',array('message'=>'msg via api','link'=>'www.google.com','privacy'=>array('value'=>'CUSTOM','friends'=>'SELF')));

?>


You can't choose what should go to the user's friends' news feed (nor top stories). This is decided by Facebook internal algorithms AND the user's friend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜