【问题标题】:Can an app post in a facebook group应用程序可以在 Facebook 群组中发帖吗
【发布时间】:2023-03-09 22:00:01
【问题描述】:

我想学习如何制作 facebook 应用程序,但我不确定是否可以做我想做的事。我知道在应用程序中可以在用户的​​墙上发布消息。我想知道是否也可以在用户所属的 facebook 群组中发布消息?

您推荐什么:javascript 或 php 应用程序?

【问题讨论】:

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


    【解决方案1】:

    是的,这是可能的。请参阅此处的文档:

    https://developers.facebook.com/docs/graph-api/reference/v2.3/group/feed

    使用最能满足您的需求且最容易编码的解决方案。两种解决方案都可以发布到该边缘。

    【讨论】:

      【解决方案2】:

      是的,这是可能的,但是在登录时您需要添加权限:“publish_actions”用于在组中发布,如果您想获得列表组您需要“user_groups”权限,但是获得批准很麻烦来自facebook,因为你需要发一个你怎么用的解释,最后你会拒绝,所以你需要另一种方式来获取群列表。

      https://developers.facebook.com/docs/graph-api/reference/v2.3/group/feed

      /* PHP SDK v5.0.0 */
      /* make the API call */
      $request = new FacebookRequest(
        $session,
        'POST',
        '/{group-id}/feed',
        array (
          'message' => 'This is a test message',
        )
      );
      $response = $request->execute();
      $graphObject = $response->getGraphObject();
      /* handle the result */
      

      或 JAVASCRIPT

       /* make the API call */
          FB.api(
              "/{group-id}/feed",
              "POST",
              {
                  "message": "This is a test message"
              },
              function (response) {
                if (response && !response.error) {
                  /* handle the result */
                }
              }
          );
      

      您可以在前端使用 javascript,在后端使用 php。这取决于您需要什么或想要什么。如果你想发布计划,我建议使用 PHP + cronjobs,但如果你

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-07-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-08-13
        • 1970-01-01
        相关资源
        最近更新 更多