Facebook - FB.getLoginStatus

时间:2012-05-25 00:01:47

标签: facebook facebook-javascript-sdk

我正在尝试使用Facebook javascript库函数:FB.getLoginStatus。 此功能在用户登录时有效,但在用户未登录到Facebook时失败。

这是我的代码:

FB.getLoginStatus(function (response) {
    console.log('entering the function!');
    if (response.status === 'connected') {
        FB.api('/me', function (response) {
            if (response.name != undefined) {
                console.log("Welcome, " + response.name);
            }
        });
    } else if (response.status === 'not_authorized') {
        console.log('not logged to app');
    } else {
        // NEVER POPUP
        console.log('user not logged');
    }
});

最后一个事件(用户未记录从不弹出),当用户未登录时,该功能不是事件触发,我看不到日志[进入功能]。

是否有人想知道Facebook用户是否已连接。

此致 Linvi

1 个答案:

答案 0 :(得分:1)

我发送了一个针对此问题的错误报告,Facebook开发人员报告说这实际上是当前已知问题。