Php 使用api在页面墙上发布不是“共享”按钮
我正在尝试使用facebook api在网页的墙上分享帖子。一切都很完美。但“分享”按钮不会出现在“喜欢”和“评论”旁边 这是我的密码Php 使用api在页面墙上发布不是“共享”按钮,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,我正在尝试使用facebook api在网页的墙上分享帖子。一切都很完美。但“分享”按钮不会出现在“喜欢”和“评论”旁边 这是我的密码 $message_body = array( 'access_token' =>Yii::app()->session['page_access_token'], 'message' => $message, 'actions' =>
$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);
知道如何将共享链接带到那里吗?使用curl,您可以使用以下命令制作帖子(是的,还有共享按钮)
curl -F 'access_token=XXXX' -F 'message=test' https://graph.facebook.com/[PAGE NAME]/feed
希望这可以像在PHP中一样使用。使用curl,您可以使用以下命令制作帖子(是的,还有共享按钮)
curl -F 'access_token=XXXX' -F 'message=test' https://graph.facebook.com/[PAGE NAME]/feed
$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);
希望这可以在PHP中按原样使用
$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,但页面墙上缺少get details链接。有没有办法把这两件事结合起来
这给了我share lin,但页面墙上缺少get details链接。有没有办法把这两个链接都放在一起?尝试发布到“/”$userpage。”/Links如果我出现此错误(#100)参数链接是必需的,这可能与“是”重复。但是我没有可共享的链接。那么在这种情况下我能做什么?尝试发布到“/”$userpage。”/Links如果我出现此错误(#100)参数链接是必需的。这可能与“是”重复。但是我没有一个链接可以分享。那么在这种情况下我能做什么呢?