我正在画布页面上设计一个Facebook应用程序。我点击按钮时调用了Facebook_login函数。我访问应用程序并单击按钮,它始终有效并显示“已连接”。但是当使用测试人员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
}
},true); }
function login(){ 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'});
}