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>
- 我打開this_page啓動,並得到彈出警報「臉譜不是成功連接」。
- 我點擊Facebook按鈕並登錄Facebook登錄。
- 後,我用Facebook登錄成功,然後重定向到this_page,但我仍然得到彈出警報的Facebook不是成功連接
,當我在運行Android Lollipop「登錄到Wi-Fi網絡」打開這happenening。有什麼不對嗎?Facebook的登錄,但仍然沒有成功
您正在使用JS SDK,所以...爲什麼不使用FB.login? – luschn
我已經使用FB.login,但登錄Facebook登錄後,突然出現空白屏幕。 – Fransiskus