开发者

How to send message to news feed with facebook sdk php

开发者 https://www.devze.com 2023-04-09 03:31 出处:网络
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.

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

精彩评论

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