开发者

post to facebook wall - PHP

i have created an application where user can post message to their own wall ! this is my code

try {
$facebook = new Facebook(FB_APIKEY, FB_SECRET);
$facebook->api_client->session_key = FB_SESSION;
$fetch = array('friends' =>
array('pattern' => '.*',
'query' => 'select uid2 from friend where uid1={$user}'));

$message = 'Hello There ...';
if ($facebook->api_client->str开发者_如何学运维eam_publish($message)) //149th line
echo 'message posted successfully';
} catch(Exception $e) {
echo $e . '<br />';
}

it returns an error Fatal error: Call to undefined method stdClass::stream_publish() in /home/webshine/public_html/tutorials/fb/example.php on line 149 what is wrong ?


to post on wall you must use api method of facebook object.

like this.

$facebook->api('/me/feed','post',$params);

You're using an old SDK methods apparently.

here is some more code

How do you post to the wall on a facebook page (not profile)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜