开发者

Facebook post wall error?

You can see this: http://disavur.com/facebook this is my code:

$user = $facebook->getUser();

if($user) { 
 开发者_运维技巧   try {
       $statusUpdate = $facebook->api('/me/feed', 'post',
                 array('name'=>'My APP on Facebook','message'=> 'I am here working',
                 'privacy'=> array('value'=>'CUSTOM','friends'=>'SELF'),
                 'description'=>'testing my description',
                 'picture'=>'https://fbcdn-photos-a.akamaihd.net/mypicture.gif',
                 'caption'=>'apps.facebook.com/myapp','link'=>'http://apps.facebook.com/myapp'));
     } catch (FacebookApiException $e) {
          echo "error";;
    }
}
else
{

    echo "<a href='" . $facebook->getLoginUrl() . "'>login</a>";
}

This code returning "error". Where is the error?


Your app needs the "publish_stream" permission to be able to post on your wall. You request this permission by setting the req_perms parameter of $facebook->getLoginUrl

echo "<a href='" . $facebook->getLoginUrl(array('req_perms' => 'publish_stream')) . "'>login</a>";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜