FB.getLoginStatus inside edge.create callback is returning unknown status and null session after logging in from the popup

送分小仙女□ 提交于 2019-12-24 03:49:33

问题


Has anybody tested the scenario below?

1- Log out of Facebook

2- Go to page that has the like button

3- Click like then log in to Facebook from the popup window

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.

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));
        });
    });

回答1:


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)


来源:https://stackoverflow.com/questions/7108290/fb-getloginstatus-inside-edge-create-callback-is-returning-unknown-status-and-nu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!