(#200)用户尚未授权应用程序执行此操作 [英] (#200) The user hasn't authorized the application to perform this action

查看:99
本文介绍了(#200)用户尚未授权应用程序执行此操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用由他们提供的Js文件来构建一个Facebook应用程序。

I am trying to build a Facebook app using Js file provided by them.

我可以获取用户注册我的应用程序,但是我必须发布Feed在墙上(也不想要用户批准的确认前的消息,用户只能登录到他/她的帐户)。

I am able to get User Registered for my App, But I have to post Feeds on their wall (also I don't want the Pre-Confirmation message for the User's Approval, User should only Login into his/her account).

以下是代码:

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>

FB.init({ appId: '<%: Facebook.FacebookApplication.Current.AppId %>', status: true, cookie: true, xfbml: true });
    var userName;


    FB.login(function (response) {
        //alert('1');
        if (response.authResponse) {
            var access_token = FB.getAuthResponse()['accessToken'];
            //alert('Access Token = ' + access_token);
            FB.api('/me', function (response) {
                alert('Good to see you, ' + response.name + '.');
                userName = response.name;
                document.getElementById('btnPostFeed').style.display = 'block';

            });
        } else {
            document.getElementById('btnPostFeed').style.display = 'none';
            //console.log('User cancelled login or did not fully authorize.');
        }
    }, { scope: '' });    

 function SubmitPost(msg) {
try {
    if (userName != null || typeof userName != 'undefined') {
        var wallPost = {
            message: msg + " By : " + userName,
            picture: '',
            link: '',
            name: 'test app posted in your wall',
            caption: '',
            description: ('Test description')
        };
        FB.api('/me/feed', 'post', wallPost, function (response) {
            if (!response || response.error) {
                /*action*/
                alert('Message could not be Posted.');
                alert(response.error.message);
            } else {
                /*action*/
                alert('Message Posted successfully.');
            }
        });
    }
    else {
        alert('Please wait while User Info is Loaded..');
    }
}
catch (err) { alert('SubmitPost: ' + err); }

我的主要问题是:
我得到(#200)用户尚未授权应用程序执行此操作

以下是App注册的屏幕截图:

Following is the Screen shot for the App Registration:

我应该怎么做这个?

推荐答案

你的范围在这一行完全是空的

Your scope is completely empty in this line

},{scope:''});

如果您不要求正确的权限,被授权给它。

If your don't request the correct permission you will not be authorized for it.


但是我必须在他们的墙上发布Feed(我也不想要预确认消息用户的批准,用户只能登录到他/她的帐户)。

But I have to post Feeds on their wall (also I don't want the Pre-Confirmation message for the User's Approval, User should only Login into his/her account).

这没有任何意义,您的用户需要批准您发布到他们的墙上如果他们只登录,他们只会授予您最基本的权限,不包括发布到他们的墙上。

This makes no sense, your user needs to approve you to post to their wall. If they only login they only grant you the most basic permissions exclusive of posting to their wall.

这篇关于(#200)用户尚未授权应用程序执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆