gpt4 book ai didi

facebook-javascript-sdk - FB.getLoginStatus() 不触发

转载 作者:行者123 更新时间:2023-12-04 06:04:41 24 4
gpt4 key购买 nike

目前 FB.getLoginStatus 在 facebook 使用新的 SDK 和 OAuth 2.0 更改后根本没有触发。
我们过去常常在 FB.getLoginStatus 中获取响应并调用我们的回调函数,该函数反过来又进行了重定向
用户访问我们的 Facebook 应用程序。

请帮忙。

代码片段 -

FB.init({
appId: '<%=ConfigurationManager.AppSettings["APIKey"]%>', // App ID
//channelURL: 'xd_receiver.htm', // Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
oauth: true // enable OAuth 2.0
//xfbml: true // parse XFBML
});
update_user_is_connected();
function update_user_is_connected()
{
FB.getLoginStatus(function(response)
{
callback();
});
}

function callback() {
var fbURL = "http://apps.facebook.com/" + '<%=Suffix%>' + "/MyPage.aspx";
eval("parent.location='" + fbURL + "'");

}

现在 FB.getLoginStatus 不起作用。

问候,
KK

最佳答案

我遇到了同样的问题并通过添加 true 来修复它作为第二个参数:

FB.getLoginStatus(function(response)  {
callback();
},
true);

这将禁用缓存并强制重新加载。见 the docs

关于facebook-javascript-sdk - FB.getLoginStatus() 不触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8500599/

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