如何在Facebook上的朋友墙上发帖?

时间:2012-08-30 06:49:55

标签: facebook-graph-api facebook-php-sdk facebook-opengraph

我正在使用facebook php sdk。我已经在我的应用程序上集成了facebook open graph。 我想在这张图片中使用开放图表在朋友墙上张贴。 我从另一个应用程序中捕获了这个图像墙贴,我希望像这样制作相同的帖子。

此外,我想制作一个像“获取应用”这样的动作链接。 当用户点击获取应用时。我的应用应该在新标签上打开。

我读过很多文档。并且他们说不可能使用开放图表在朋友墙上发帖,我尝试了$ facebook-> api('/ $ firend_id / feed),但它在朋友墙上发布了一个链接。 我不想要链接,我想把礼物发布给朋友墙。

请建议我怎么办?

此致 克里希纳post form other's app

2 个答案:

答案 0 :(得分:1)

根据附件的不同,我认为您的意思是“如何向墙上的帖子添加操作链接?”见https://developers.facebook.com/docs/opengraph/actionlinks/

答案 1 :(得分:0)

我用命中和试用方法解决了它。

$attachment = array(
             'message' => $d['giftmsg'],
            'name' => 'You have recived a gift voucher for a '.$dd['title'].'!' .'',
            'link'=>'https://thevoucherlink.com/redirect.php',
            'description' => " Please click on the link to claim your gift card. Do it soon! This promotional card is valid for a limited time.. <center>&nbsp;</center> The Voucher Link allows facebook users send gift vouchers from local businesses to their friends",
            'picture' => $im,
            'actions'=>array('name'=>'Get Voucher','link'=>'https://thevoucherlink.com/redirect.php')
        );  


        try {
             $t=    $facebook->api('/' . $_POST['friend_id']. '/feed', 'POST', $attachment);
        } catch (Exception $exc) {
            $err= $exc->getTraceAsString();
        }

您可以在帖子上使用这些参数制作相同的帖子。

感谢您的回答..