1

我正在画布页面上设计一个 Facebook 应用程序。单击按钮时,我调用了 Facebook_login 函数。Wnen 我访问该应用程序并单击按钮,它始终有效并显示“已连接”。但是,当使用测试人员的 Facebook 帐户时,无论测试人员是否授权了应用程序,response.status 始终是“not_authorized”。我真的很困惑。有人可以帮我弄清楚吗?任何建议将不胜感激。

函数 Facebook_login() {

 FB.getLoginStatus(function(response) {

    if (response.status == 'connected') {
      alert(response.status);
     var uid = response.authResponse.userID;
     var accessToken = response.authResponse.accessToken;
     var signed_request = response.authResponse.signedRequest;
    } else if (response.status == 'not_authorized') {
      alert(response.status);
      login();
    } else {
     //cancelled
    }

}, 真的); }

功能登录(){ FB.login(功能(响应){

    if (response.authResponse) {
      var uid = response.authResponse.userID;
       console.log('Welcome!  Fetching your information.... ');
        FB.api('/'+uid, function(response) {
        console.log('Good to see you, ' + response.name + '.');
        });
    } else {
        // cancelled    
    }
 },{scope:'email,publish_checkins,publish_actions,publish_stream'});

}

4

0 回答 0