1

I am building an iphone app with phonegap, and using the facebook javascript sdk.

  FB.getLoginStatus(function(response){
    if(response.status === 'connected'){
      alert("connected");
      var uid = response.authResponse.userID;
      var accessToken = response.authResponse.accessToken;
    } 
    else if(response.status === 'not_authorized'){
      login();
    }
    else{
      login();
    }
   });

This function checks the status. But it alerts "connected" even i am not logged in to facebook with the xcode iphone simulator.

4

1 回答 1

0

我认为这是因为您已登录,可能是在浏览器或 FB 应用程序上。就我而言,当我在智能手机上进行测试时,FB.getLoginStatus 方法总是提示“已连接”,因为我已登录 FB 应用程序。

于 2013-06-20T15:46:52.813 回答