Phonegap - FB.getLoginStatus始终返回true

时间:2013-10-15 15:27:09

标签: android facebook cordova

我正在构建一个带有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。有什么想法吗?

0 个答案:

没有答案