我现在有点困惑,因为我无法弄清楚以下代码可能出现的问题,因为它不起作用。
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => 'myapplicationid',
'secret' => 'myapplicationsecret',
));
$attachment = array(
'access_token'=> "user access token",
'message' => "Message Goes Here",
'name' => 'Title goes here',
'caption' => "some text",
'link' => 'https://apps.facebook.com/somelink/',
'description' => 'some description',
'picture' => "http://example.com/test.jpg"
);
try {
// Proceed knowing you have a user who is logged in and authenticated
$result = $facebook->api("/$userid/feed/",'post',$attachment);
} catch (FacebookApiException $e) {
error_log($e);
//$user = null;
}
在验证和获取访问令牌时,我从用户电子邮件、publish_stream、publish_actions 获得了以下权限。我认为 publish_stream 是推送墙帖所需的。在这方面的任何帮助将不胜感激。