script type="text/javascript">
function statusChangeCallback(response) {
if (response.status === 'connected') {
alert("Facebook Success Connected");
testAPI();
} else {
alert("Facebook Not Success Connected");
}
}
function onClickLogin(){
window.location = "https://www.facebook.com/v2.10/dialog/oauth/?client_id=885565114939555&redirect_uri=https://www.xxx.id/this_page.php&scope=public_profile,email,user_birthday";}
window.fbAsyncInit = function()
FB.init({
appId : '885565114939555',
cookie : true,
xfbml : true,
version : 'v2.8'
});
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.10&appId=885565114939555";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function testAPI() {
FB.api('/me', 'GET', {"fields":"id,name,email,birthday"}, function(response) {
window.location = "https://www.xxx.id/xxx.php" + sUrl + "&name=" + response.name + "&id=" + response.id + "&email=" + response.email + "&bd=" + response.birthday;
});
}
/script>
<button onclick="javascript:onClickLogin();">facebok</button>
当我在android lollipop中打开时,会发生这种情况&#34;登录到Wi-Fi网络&#34;。有什么不对吗?
答案 0 :(得分:0)
console.log(response)
并查看您获得的确切错误回复。
供参考,您可以尝试使用此代码https://developers.facebook.com/docs/facebook-login/web#example也许这可以让您更好地了解。