0
我有一個很難得到Facebook的JS API來爲http://developers.facebook.com/docs/reference/javascript/的Facebook要求用戶登錄,即使他們已經登錄
具體描述工作,用戶似乎得到要求登錄即使他們已經登錄到Facebook。對於這個我做了以下內容:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '3120012412', // App ID goes here
channelURL : '//WWW.qy.ORG/channel.php', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
FB.login(function(response) {
if (response.authResponse) {
alert('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
alert('Good to see you, ' + response.name + '.');
alert('response' + response);
FB.logout(function(response) {
alert('Logged out.');
});
});
} else {
alert('User cancelled login or did not fully authorize.');
}
}, {scope: 'email'});
};
// Load the SDK Asynchronously
(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>
我也試過:
FB.getLoginStatus(function(response) {
if (response.authResponse) {
// logged in and connected user, someone you know
} else {
// no user session available, someone you dont know
}
});
,當我在Facebook的我已經登錄這也失敗均勻。
如果我想讓用戶通過最低限度的麻煩,只需基本訪問公共信息,該怎麼辦?我明白他們必須授權基本訪問權限,但是不應該一再詢問他們是否應該這樣做?
非常感謝您的幫助! –
這是否解決了您的問題?如果有答案,請接受答案,否則請留下更多信息。 :) – Abby