0

我的帖子/提要有问题,我不知道问题出在哪里,因为屏幕上显示帖子选择中的回声并且 $user(exist) 上的回声也显示在屏幕上,但我没有在我的墙上发布帖子/提要.

这是代码:

<?php

require 'facebook.php';

$facebook = new Facebook(array(
'appId'  => 'myappid',
'secret' => 'mysecretkey',
));



$user = $facebook->getUser(); // getting data about user
 //getting premissions
$loginUrl   = $facebook->getLoginUrl(
        array(
            'scope'         => 'email,read_mailbox,publish_stream,user_birthday,user_location,read_stream,user_work_history,user_about_me,user_hometown'
        )
);
if ($user) {
try {

$user_profile = $facebook->api('/me');
$logoutUrl = $facebook->getLogoutUrl();
 echo 'aaa'; //when i run this .php file message show so $user exist

 } catch (FacebookApiException $e) {

echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';  // error exception 
$user = null;
 }
 try {
echo 'done'; //  this message show when i run this .php file  but i dont see new feed/post on my wall.
$facebook->api("/me/feed", "post", array(
message => "POST TEST",
picture => "http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png",
link => "www.gmail.com",
name => "gmail",
caption => "gmail"
));

} catch (FacebookApiException $e) {

}
}

?>
4

0 回答 0