FB.getLoginStatus返回状态未知

时间:2015-05-14 05:40:30

标签: ios cordova facebook-javascript-sdk phonegap-plugins phonegap-build

我正在使用ios的cordova facebook插件。

FB.getLoginStatus(function(response) {
    console.log(JSON.stringify(response));
});

FB.login(
    function(response)
{});

我收到此错误{"status":"unknown","authResponse":null}

1 个答案:

答案 0 :(得分:0)

正如Facebook文档中所述,FB.getLoginStatus将返回三个可能的响应:

  • 用户已登录Facebook并已验证您的身份 申请(已连接)
  • 用户已登录Facebook,但未对您进行身份验证 申请(未授权)
  • 此时用户尚未登录Facebook,因此我们不会登录 知道他们是否已经验证了您的应用程序(未知)。



  FB.getLoginStatus(function(response) {
           if (response.status === 'connected') {
              // the user is logged in and has authenticated your app
              // show Open Graph related features here. Such as Frictionless sharing
           } else if (response.status === 'not_authorized') {
              // the user is logged in to Facebook, but has not authenticated your app
              // show user Facebook status
           } else {
               // the user isn't logged in to Facebook.
               // Hide all Facebook status mockups.
           }
        });