从弹出窗口登录后,edge.create回调内部的FB.getLoginStatus返回未知状态和空会话 [英] FB.getLoginStatus inside edge.create callback is returning unknown status and null session after logging in from the popup
问题描述
有人测试过以下情况吗?
Has anybody tested the scenario below?
1-退出Facebook
1- Log out of Facebook
2-转到具有赞"按钮的页面
2- Go to page that has the like button
3-单击,然后从弹出窗口登录Facebook
3- Click like then log in to Facebook from the popup window
我已订阅edge.create并调用FB.getLoginStatus(function(response){});为了确保在单击喜欢"按钮时用户已登录.
I am subscribed to edge.create and calling FB.getLoginStatus(function(response) { }); in order to make sure the user is logged in when the like button is clicked.
单击赞"按钮时,响应状态未知,会话为null,这不是我期望的.
When the like button is clicked, response status is unknown and session is null which is not what I'm expecting there.
FB.Event.subscribe('edge.create', function(href) {
FB.getLoginStatus(function(response) {
alert("inside edge create login status callback" + JSON.stringify(response));
});
});
推荐答案
找到了解决方案:使用第二个参数"true"调用FB.getLoginStatus会强制其从服务器获取登录状态.
Found the solution: Calling FB.getLoginStatus with the second param "true" forces it to get the login status from the server.
FB.getLoginStatus(function(response) {}, true)
这篇关于从弹出窗口登录后,edge.create回调内部的FB.getLoginStatus返回未知状态和空会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!