简体   繁体   English

在Facebook Wal上发布时,如何解决“(#200)用户未授权应用程序执行此操作”错误

[英]How to fix “(#200) The user hasn't authorized the application to perform this action” error while posting on facebook wal

I am getting "(#200) The user hasn't authorized the application to perform this action" error when posting message on user's facebook wall. 在用户的Facebook墙上发布消息时,出现“(#200)用户未授权应用程序执行此操作”错误。 I am using facebook graph API. 我正在使用facebook graph API。 I have also set the "publish_actions" permission in the scope, but didn't working. 我还在范围内设置了“ publish_actions”权限,但没有起作用。 My code is 我的代码是

require 'facebook/facebook.php';

$facebook = new Facebook(array(
            'appId' => APP_ID,
            'secret' => APP_SECRET,
            ));

$user = $facebook->getUser();

if ($user) {
    $accessToken = $facebook->getAccessToken();

    try {
        //create message with token gained before
        $post =  array(
            'access_token' => $accessToken,
            'message' => 'Test message'
        );

        $res = $facebook->api('/me/feed', 'POST', $post);

    } catch (FacebookApiException $e) {
        error_log($e);
        $user = null;
    }
} else {
    # There's no active session, let's generate one
    $login_url = $facebook->getLoginUrl(array(
        'scope' => 'publish_actions'
    ));
    header("Location: " . $login_url);
}

Can you please suggest me what i am missing in the code or in the app? 您能建议我代码或应用程序中缺少的内容吗?

Since you mentioned that it does work for Admins, but not for anyone else, it´s very clear what the problem is: You need to go through Login Review with publish_actions - else, that permission will only work for users with a role in the App. 由于您提到它确实适用于Admins,但不适用于其他任何人,所以很清楚问题出在哪里:您需要使用publish_actions进行Login publish_actions否则,该权限仅对具有以下角色的用户有效:应用。

All the information you need about Login Review is in the docs: https://developers.facebook.com/docs/facebook-login/review 您需要有关Login Review的所有信息都在docs中: https : //developers.facebook.com/docs/facebook-login/review

暂无
暂无

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

相关问题 错误:#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 Php Post Facebook Graph返回错误:(#200)用户未授权应用程序执行此操作 - Php Post Facebook Graph returned an error: (#200) The user hasn't authorized the application to perform this action Facebook错误(#200)用户未授权应用程序执行此操作(PHP) - Facebook Error (#200) The user hasn't authorized the application to perform this action (PHP) (#200)用户未授权应用程序执行此操作facebook php api错误? - (#200) The user hasn't authorized the application to perform this action facebook php api error? 错误 (#200) 用户尚未授权应用程序执行此操作 facebook graph api php codeigniter - Error (#200) The user hasn't authorized the application to perform this action facebook graph api php codeigniter 未捕获的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) php(#200)用户未授权应用程序执行此操作 - php (#200) The user hasn't authorized the application to perform this action Facebook-sdk给出了“(#200)用户没有授权应用程序执行此操作”在带有codeigniter的自动帖子上 - Facebook-sdk Gives “(#200) The user hasn't authorized the application to perform this action” on auto post with codeigniter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM