如何使用 graph api 4.0 post 在 facebook 时间轴上显示图像?
How to post image on facebook timeline using graph api 4.0?
我正在使用图表 API 4.0 在我的 Facebook 时间线上创建一个 API 到 post。为此,我首先创建一个相册,然后在该相册中创建 post 图片。
这是代码
$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);
}
其中 returns 一个错误
Raw Provider API response: {\"error\":{\"message\":\" This object does not exist or does not support this action\"
但是当我提供页面令牌而不是用户访问令牌时,它工作正常。我是新来的。所以,我不知道如何解决这个问题。
Facebook API 不再允许发布到个人资料供稿。
https://developers.facebook.com/docs/graph-api/reference/v4.0/user/feed#publish
As of April 24,2018, the publish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.
我正在使用图表 API 4.0 在我的 Facebook 时间线上创建一个 API 到 post。为此,我首先创建一个相册,然后在该相册中创建 post 图片。
这是代码
$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);
}
其中 returns 一个错误
Raw Provider API response: {\"error\":{\"message\":\" This object does not exist or does not support this action\"
但是当我提供页面令牌而不是用户访问令牌时,它工作正常。我是新来的。所以,我不知道如何解决这个问题。
Facebook API 不再允许发布到个人资料供稿。
https://developers.facebook.com/docs/graph-api/reference/v4.0/user/feed#publish
As of April 24,2018, the publish_actions permission has been removed. Please see the Breaking Changes Changelog for more details. To provide a way for your app users to share content to Facebook, we encourage you to use our Sharing products instead.