Error (#200) The user hasn't authorized the application to perform this action facebook graph api php codegniter -
here permissions
$config['facebook']['permissions'] = array( 'email', 'user_location', 'user_birthday', 'publish_actions', 'manage_pages', 'public_profile', );
i can not post on facebook page admin.it gives me error
exception occured, code: 200 message: (#200) user hasn't authorized application perform action
if remove 'access_token' => $pagelist['access_token'],
can post on page not admin.but when add line gives me above error can tell me why here function pagepost using post on page
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 id: " . $request->getproperty('id'); $page = $request->getgraphobject()->asarray(); return $page; } catch(facebookrequestexception $e) { echo "exception occured, code: " . $e->getcode(); echo " message: " . $e->getmessage(); } } return false; }
can tell me wrong. thankfull.
to post page "as page", need authorize user "publish_pages
" , need use page token. try add publish_pages
permission list:
$config['facebook']['permissions'] = array( 'email', 'user_location', 'user_birthday', 'publish_actions', 'publish_pages', 'manage_pages', 'public_profile', );
Comments
Post a Comment