drecy22400 2019-07-27 04:02 采纳率: 0%
浏览 78

您是否可以在不使用Facebook API管理员的情况下以群组形式发布?

I am trying to link a system of publications that I have with the Facebook API, to give my users the option to publish their articles on social networks automatically. The question is: Am I a member of several groups, (only admin 2), Can I publish content in groups in which I do not administer (being a member), or is it only possible to publish in the groups I manage? ..

The second I have already solved (I can already publish in the groups I manage), my code is something like this:

 public function publicar($titulo, $url){
        $e= new configuracionController();
        $userid=$e->getFbUserId();
        $accessToken = $empresa->getFBToken();


        $datos = array(
            'message'=> $titulo,
            'link' => $url
            );



        try {
            $requestGroups = $this->fb->get('/me/groups', $accessToken);
            $groups = $requestGroups->getGraphEdge()->asArray();
        } catch(Facebook\Exceptions\FacebookResponseException $e) {
            // When Graph returns an error
            echo 'Graph returned an error: ' . $e->getMessage();
            exit;
        } catch(Facebook\Exceptions\FacebookSDKException $e) {
            // When validation fails or other local issues
            echo 'Facebook SDK returned an error: ' . $e->getMessage();
            exit;
        }





        foreach ($groups as $key) {
            try {
                $requestMultiPost = $this->fb->post('/' . $key['id'] . '/feed', $datos,  $accessToken);
                $multiPost = $requestMultiPost->getGraphNode()->asArray();
            } catch(Facebook\Exceptions\FacebookResponseException $e) {
                // When Graph returns an error
                echo 'Graph returned an error: ' . $e->getMessage();
                exit;
            } catch(Facebook\Exceptions\FacebookSDKException $e) {
                // When validation fails or other local issues
                echo 'Facebook SDK returned an error: ' . $e->getMessage();
                exit;
            }
        }


        print_r($multiPost);


    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作