我的帖子/ Feed有问题,我不知道问题出在哪里因为屏幕上的帖子选择显示回显而且$ user(存在)上的回音也显示在屏幕上但是我没有发布/提交在我的墙上。
这是代码:
<?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) {
}
}
?>