gpt4 book ai didi

javascript - FB.getLoginStatus 返回状态未知

转载 作者:行者123 更新时间:2023-11-30 05:14:58 27 4
gpt4 key购买 nike

使用有效的 Facebook 应用程序调用 FB.getLoginStatus 时,响应状态始终未知。确切的响应是 {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>


示例网址: http://media.tuentifotos.com/simple_test.html


这是 Facebook 应用程序设置的屏幕截图。 Facebook App Settings

最佳答案

我在 Chrome 中发生了这种情况,因为 Chrome 配置为阻止第三方 cookie 和数据。

一旦我更改了配置,FaceBook 就可以毫无问题地让我登录我的应用程序。

  • Chrome 设置
  • 显示高级设置...
  • 隐私
  • 内容设置...
  • 取消选中阻止第三方 cookie 和网站数据

关于javascript - FB.getLoginStatus 返回状态未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22889646/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com