小编Die*_*yol的帖子

FB.getLoginStatus返回状态未知

使用有效的Facebook App调用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>
Run Code Online (Sandbox Code Playgroud)


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


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

javascript facebook facebook-javascript-sdk

19
推荐指数
3
解决办法
2万
查看次数