[英]posting on a pages wall using api is not giving share button
我正在嘗試使用facebook api在頁面牆上分享帖子。 一切正常。 但是“分享”按鈕並沒有在“喜歡和評論”旁邊。
這是我的代碼
$message_body = array(
'access_token' =>Yii::app()->session['page_access_token'],
'message' => $message,
'actions' => array(
array(
'name' => Yii::t('UserController', ' Get details '),
'link' => Yii::app()->createAbsoluteUrl ('user/adminmoreaboutprovider?&postId='.$fbPostId ),
),
),
);
$facebook->api("/".$userpage."/feed","post",$message_body);
知道如何在此處帶來共享鏈接嗎?
$msg_body = array(
'message' => $message,
'actions' => array(
array(
'name' => 'Get details',
'link' => Yii::app()->createAbsoluteUrl('user/adminmoreaboutprovider?&postId='.$fbPostId ),
)
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/6creeks/feed');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $msg_body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); //to suppress the curl output
$result= curl_exec($ch);
curl_close ($ch);
這給了我share lin,但是“獲取詳細信息”鏈接在“頁面”牆上丟失了。 有什么辦法可以將兩者結合起來嗎?
使用curl可以使用以下命令發布信息(是,還有“分享”按鈕)。
curl -F 'access_token=XXXX' -F 'message=test' https://graph.facebook.com/[PAGE NAME]/feed
希望可以像在PHP中那樣使用它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.