Oauth 2.0 使用oauth opt-in登录,使用JavaScript SDK登录时出现应用程序错误

Oauth 2.0 使用oauth opt-in登录,使用JavaScript SDK登录时出现应用程序错误,oauth-2.0,facebook-javascript-sdk,Oauth 2.0,Facebook Javascript Sdk,这是我的密码: FB.init({ appId : this.api_id, status : true, cookie : true, xfbml : true, oauth : true, channelUrl : 'https://blah.com/facebook/channel' // custom channel }); FB.login(function(response) { if (response.authRe

这是我的密码:

FB.init({
    appId  : this.api_id,
    status : true,
    cookie : true,
    xfbml  : true,
    oauth  : true,
    channelUrl  : 'https://blah.com/facebook/channel'  // custom channel
});
FB.login(function(response) {
    if (response.authResponse) {
        if (response.perms) {
        // user is logged in and granted some permissions.
        if(typeof redirect === 'function') {
            redirect();
        }else {
            window.location = redirect;
            }
        } else {
        // user is logged in, but did not grant any permissions
        }
    } else {
        // user is not logged in
    }
},{
        scope: 'email'
}
);
所以,如果我在FB.init中没有设置oauth,那么一切正常,但是如果我添加了 是真的那么我会回来的

<span>Application Error: There was a problem getting data for the application you requested. The application may not be valid, or there may be a temporary glitch. Please try again later. </span>
应用程序错误:获取您请求的应用程序的数据时出现问题。应用程序可能无效,或者可能存在临时故障。请稍后再试。
从请求到/dialog/oauth

我在这里遵循了oauth 2的所有路线图 还是没有运气,这里似乎有点不对劲

没有,所有的代码不是我所有的代码,在调用FB.login之前,我确保
FB.init已被调用。非常感谢您的帮助

检查您的应用程序是否处于沙箱模式。如果是,请关闭沙盒模式并重试。 如果启用沙盒模式,FB将无法识别您的应用程序,并且在您未登录时,对Facebook.init的调用将以静默方式失败,并返回响应“应用程序错误:获取您请求的应用程序的数据时出现问题”。应用程序可能无效,或者可能存在临时故障。请稍后再试。”