我正在构建一个带有phonegap 3.0.0,Android 4.2和phonegap-facebook插件的应用https://github.com/jimzim/phonegap-facebook-android-sample
我正在检查用户是否通过Facebook登录。但无论如何,我总是得到“连词”的回应。
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
alert('in the if');
alert('uid is ');
alert(response.authResponse.userID);
} else if (response.status === 'not_authorized') {
alert('in the else if');
} else {
alert('in the else');
}
}, true);
“true”参数确保将请求发送到Facebook服务器,而不仅仅是返回的缓存响应。但是,即使我从Facebook设置中删除应用程序,从本机应用程序注销Facebook并从浏览器注销,我总是得到“已连接”的值。
此外,userID以“undefined”的形式返回,但正确返回了accessToken。有什么想法吗?