Facebook GraphApi -> 错误:UOAuthException:(#282) 需要扩展权限:抛出shar


Facebook GraphApi -> Error : UOAuthException: (#282) Requires extended permission: share_item thrown

我在尝试使用 Facebook Graph API 自动发布链接时收到错误

我的 php 代码

<?
  $config = array();
  $config['appId'] = '3545XXXXXXX6207';
  $config['secret'] = '60068XXXXXXXXXXXe45a426';
  $facebook = new Facebook($config);
$retour_login = json_decode(stripslashes($_GET['session']), true);
$uid = $retour_login['uid'];
$access_token = $retour_login['access_token'];
$me = null;
if ($session) {
  try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
  }
}
if(!isset($_GET['session'])) { // Asking permissions
    $params = array(
    'locale' => 'fr_FR',
    'display' => 'popup', 
    'req_perms' => 'email,user_about_me,user_birthday,user_location',
    'ext_perms' => 'publish_stream,share_item,manage_pages'
    );
    header("Location: ".$facebook->getLoginUrl($params));
}

        $args = array(
                'message'   => "XXXX",
                'link'      => 'XXXX',
                'name'      => 'XXXX',
                'picture'   => 'XXXX',
                "caption"=> "lien.com",
                      "type"=> "link");
        $post_id = $facebook->api("/me/links", "post", $args); // execute this to automatically post on FB
?>

我收到此错误:OAuth异常:(#282)需要扩展权限:抛出share_item

有什么想法吗?

谢谢!

什么是"req_perms"和"ext_perms"? 根据文档,权限应位于"范围"参数中 - https://developers.facebook.com/docs/reference/dialogs/oauth/和 https://developers.facebook.com/docs/authentication/

检查您不是使用过时的示例或教程 - 请务必先检查官方文档