FB.getLoginStatus()返回“未知”在用户登录时在Firefox中 [英] FB.getLoginStatus() return "unknown" in Firefox when user is logged

查看:143
本文介绍了FB.getLoginStatus()返回“未知”在用户登录时在Firefox中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站中,我测试用户是否登录Facebook,以建议他/她喜欢我的Facebook网站页面。

In my site I test if a user is logged on Facebook in order to suggest him/her to like my Facebook site page.

然后,我使用常规Facebook Js SDK功能,以了解用户是否被记录:

Then, I use the conventional Facebook Js SDK function to understand if the user is logged or not:

FB.getLoginStatus(function(response) {
    if (response.status === 'connected') {
        var accessToken = response.authResponse.accessToken;
        fbuid = response.authResponse.userID;
        status = 'connected';
    } else if (response.status === 'not_authorized') {
        fbuid = null;
        status = 'not_authorized';
    } else { // the user isn't logged in to Facebook.
        status = 'generic';
        fbuid = 1;
    }

    that.evaluateFbStatus(status, fbuid);
}

它除了Firefox以外,与每个浏览器完美匹配。

It works perfectly with every browsers except Firefox.

在Firefox中,即使t,它总是返回 unknown 他的用户登录在Facebook上,状态为 not_authorized 已连接

In Firefox it returns always unknown even if the user is logged on Facebook and the status is not_authorized or connected.

接受任何帮助。 p>

Any help is accepted.

推荐答案

问题是由于第三方Cookie。

The problem is due to third party cookies.

要使用Facebook Firefox中的SDK功能需要打开设置和第三方Cookie首选项>隐私权>接受第三方Cookie

To use Facebook SDK functions in Firefox, is necessary to open setting and able third party cookies Preferences > Privacy > Accept-third-party cookies

查看有关详情,请参阅此页面

Have a look on this page for more details.

这篇关于FB.getLoginStatus()返回“未知”在用户登录时在Firefox中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆