错误(#200)用户没有';t授权应用程序执行此操作


Error (#200) The user hasn't authorized the application to perform this action

我想用PHP向Facebook页面发送消息,但我有这个错误

(#200(用户尚未授权应用程序执行此操作。

我是Facebook页面和Facebook应用程序的管理员。

我想我有这个问题是因为我没有好的权限,但我不知道如何拥有这个。

我在网上搜索了很多有相同问题的页面,但我没有找到答案。

它们是我的权限。

array(1) {
         ["data"]=> array(3) {
                     [0]=> array(2) {
                         ["permission"]=> string(9) "installed"
                         ["status"]=> string(7) "granted"
                         }
                     [1]=> array(2) {
                         ["permission"]=> string(14)"public_profile"
                         ["status"]=> string(7) "granted" 
                     }
                    [2]=> array(2) {
                         ["permission"]=> string(12) "manage_pages"
                         ["status"]=> string(7) "granted" } } } 

这是我的密码。

$permissions = 'manage_pages, publish_stream';
$fb = new Facebook(array('appId'=>$appId, 'secret'=>$secret));
 $fbuser = $fb->getUser();
 if($fbuser){
    $permissions = $fb->api('/me/permissions');
    if(isset($_POST['msg']) and $_POST['msg']!=''){
        try{
            $message = array(
                'access_token' => $token,
                'message' => $_POST['msg']
            );
         //   $posturl = '/'.$_POST['pageid'].'/feed';
            $posturl = '/me/feed';
            $result = $fb->api($posturl,'POST',$message);
            if($result){
                echo 'Successfully posted to Facebook Wall...';
            }
        }catch(FacebookApiException $e){
            echo $e->getMessage();
        }
    }

}else{
    $fbloginurl = $fb->getLoginUrl(array('redirect-uri'=>$returnurl, 'scope'=>$permissions));
    echo '<a href="'.$fbloginurl.'">Login with Facebook</a>';
 }

您可以在响应中看到未授予发布权限。

原因是publish_stream现在已被弃用;请改用publish_actions