简体   繁体   English

错误 (#200) 用户尚未授权应用程序执行此操作 facebook graph api php codeigniter

[英]Error (#200) The user hasn't authorized the application to perform this action facebook graph api php codeigniter

Here are my permissions这是我的权限

$config['facebook']['permissions'] = array(
  'email',
  'user_location',
  'user_birthday',
  'publish_actions',
  'manage_pages',
  'public_profile',
);

I can not post on a facebook page as a admin.我无法以管理员身份在 Facebook 页面上发帖。 It gives me this error它给了我这个错误

Exception occured, code: 200 with message: (#200) The user hasn't authorized the application to perform this action

if I remove 'access_token' => $pageList['access_token'], then I can post on the page but not as a admin.but when I add this line it gives me this above error can anyone tell me why Here is my function pagePost which I am using to post on a page如果我删除'access_token' => $pageList['access_token'],那么我可以在页面上发帖,但不能以管理员身份发帖。但是当我添加这一行时,它给了我上面的错误,谁能告诉我为什么这是我的函数我用来在页面上发布的 pagePost

 public function pagePost() {
    if ( $this->session ) {

    try {

      $pageAccessToken;
      $request_page = new FacebookRequest($this->session, 'GET', '/1420447421611683?fields=access_token,name,can_post');
      $pageList = $request_page->execute()
        ->getGraphObject()
        ->asArray();

      $request = ( new FacebookRequest( $this->session, 'POST', '/1420447421611683/feed',array(
                    'access_token'  => $pageList['access_token'],
                    'link' => 'www.example.com',
                    'message' => 'Hello Up',
                  ) ) )->execute();
        echo "Posted with id: " . $request->getProperty('id');

        $page = $request->getGraphObject()->asArray();
      return $page;
    } catch(FacebookRequestException $e) {
            echo "Exception occured, code: " . $e->getCode();
            echo " with message: " . $e->getMessage();
      }
    }
    return false;
  }

What is wrong?怎么了?

To post to a Page "as Page", you need to authorize the user with " publish_pages " and you need to use a Page Token.要发布到“作为页面”的页面,您需要使用“ publish_pages ”授权用户,并且您需要使用页面令牌。 Try to add publish_pages to your permission list:尝试将publish_pages添加到您的权限列表中:

$config['facebook']['permissions'] = array(
  'email',
  'user_location',
  'user_birthday',
  'publish_actions',
  'publish_pages',
  'manage_pages',
  'public_profile',
);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Php Post Facebook Graph返回错误:(#200)用户未授权应用程序执行此操作 - Php Post Facebook Graph returned an error: (#200) The user hasn't authorized the application to perform this action (#200)用户未授权应用程序执行此操作facebook php api错误? - (#200) The user hasn't authorized the application to perform this action facebook php api error? Facebook错误(#200)用户未授权应用程序执行此操作(PHP) - Facebook Error (#200) The user hasn't authorized the application to perform this action (PHP) Facebook-sdk给出了“(#200)用户没有授权应用程序执行此操作”在带有codeigniter的自动帖子上 - Facebook-sdk Gives “(#200) The user hasn't authorized the application to perform this action” on auto post with codeigniter php(#200)用户未授权应用程序执行此操作 - php (#200) The user hasn't authorized the application to perform this action 错误:#200用户未授权应用程序执行此操作 - Error:#200 The user hasn't authorized the application to perform this action 错误(#200)用户未授权应用程序执行此操作 - Error (#200) The user hasn't authorized the application to perform this action 在Facebook Wal上发布时,如何解决“(#200)用户未授权应用程序执行此操作”错误 - How to fix “(#200) The user hasn't authorized the application to perform this action” error while posting on facebook wal 未捕获的OAuthException:(#200)用户尚未授权应用程序执行此操作 - Uncaught OAuthException: (#200) The user hasn't authorized the application to perform this action 用户尚未授权应用程序执行此操作(#200) - the user hasn't authorized the application to perform this action(#200)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM