[英]How to post on group wall of facebook
I want to post on group wall. 我想在组墙上发布。 I have permission of "user_groups" and "publish_stream". 我具有“ user_groups”和“ publish_stream”的权限。 and also access_token. 以及access_token。
and here is my code: 这是我的代码:
try{
$statusUpdate = $this->facebook->api('/'.$group_id.'/feed', 'post',
array(
'name' => stripslashes($productname),
//'caption'=>$caption,
'message' => $message,
'description' => $description,
'picture' => $picture,
'link'=>$link));
$postid = $statusUpdate['id']; // return id
} catch (Exception $e){
$postid = 0;
}
return $postid; // return id
}
When I run this code I get a return id which was the page id. 当我运行此代码时,我得到一个返回ID,即页面ID。 but nothing post on my group wall. 但是在我的小组墙上没有任何内容。 how to solve this? 如何解决呢?
This code works for me to post to a facebook page. 此代码对我有用,可以发布到Facebook页面。
This is a snippet 这是一个片段
foreach ($pages as $key => $value) {
$params = array(
'access_token' => $value['access_token'],
'message' => $message
);
// ask facebook api to post the message to the selected page
$facebook->api()->api( "/" . $value['id'] . "/feed", 'POST', $params );
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.