【问题标题】:How to post image on facebook timeline using graph api 4.0?如何使用图形 api 4.0 在 facebook 时间轴上发布图像?
【发布时间】:2019-09-11 17:04:30
【问题描述】:

我正在使用图形 API 4.0 创建一个 API 以在我的 Facebook 时间轴上发布。为此,我首先创建一个相册,然后在该相册中发布图片。

这里是代码

$facebook = new Facebook(array(
    'appId'  => 'APP_ID',
    'secret' => 'APP_SECRET',
    'cookie' => true,
));

$user = $facebook->getUser();
if ($user) {

  //Create an album
  $album_details = array(
        'message'=> 'Album desc',
        'name'=> 'Album name'
  );
  $create_album = $facebook->apiRequest('/me/albums/{user-access-token}', 'post', $album_details);

  dd($create_album);

}

返回错误

Raw Provider API response: {\"error\":{\"message\":\" This object does not exist or does not support this action\"

但是当我给页面令牌而不是用户访问令牌时,它工作正常。我是新来的。所以,我不知道如何解决这个问题。

【问题讨论】:

    标签: laravel facebook-graph-api


    【解决方案1】:

    Facebook API 不再允许发布到个人资料供稿。

    https://developers.facebook.com/docs/graph-api/reference/v4.0/user/feed#publish

    自 2018 年 4 月 24 日起,publish_actions 权限已被移除。有关更多详细信息,请参阅重大更改更新日志。为了让您的应用用户能够向 Facebook 分享内容,我们鼓励您改用我们的分享产品。

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-04
      • 1970-01-01
      • 2014-08-10
      • 2012-12-22
      相关资源
      最近更新 更多