FB.getLoginStatus返回状态未知 [英] FB.getLoginStatus returns status unknown

查看:608
本文介绍了FB.getLoginStatus返回状态未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用有效的Facebook应用响应状态调用FB.getLoginStatus永远是未知的。确切的回应是{authResponse:未定义,状态:未知}

When calling FB.getLoginStatus using a valid Facebook App the response status is always unknown. Exact response is {authResponse: undefined, status: "unknown"}.

<html>
<body>
    <div id="fb-root"></div>

    <script>
    window.fbAsyncInit = function(){
        FB.init({ appId:'1484134468466778', status:true,  cookie:true, xfbml:true});
        FB.getLoginStatus(function(response){
        console.log(response);
        });
    };

    (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
    </script>
</body>
</html>

结果

例如网址:
<一href=\"http://media.tuentifotos.com/simple_test.html\">http://media.tuentifotos.com/simple_test.html

结果

下面一个Facebook应用程序设置的屏幕截图。

Here a screenshot of the Facebook App Settings.

推荐答案

这是在Chrome发生我,是因为Chrome的配置为阻止第三方Cookie和数据。

This was happening for me in Chrome, and was because Chrome was configured to block third-party cookies and data.

在我做了配置更改,Facebook是能够给我登录到我的应用程序没有问题。

Once I made that configuration change, FaceBook is able to log me into my app without a problem.


  • Chrome设置

  • 显示高级设置...

  • 隐私

  • 内容设置...

  • 取消选中阻止第三方Cookie和网站数据

  • Chrome Settings
  • Show advanced settings...
  • Privacy
  • Content settings...
  • uncheck Block third-party cookies and site data

这篇关于FB.getLoginStatus返回状态未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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