我一直在努力解决这个问题。我的登录和身份验证工作正常,但当用户单击连接按钮并且必须登录我的应用程序时,应用程序名称"没有出现在Facebook登录页面上。使它看起来粗略。在桌面上正常工作,但不会在移动设备上显示。
这是一个链接。 i.imgur.com/2Qf17R5.png
这是我的代码......
<!-- FB Script -->
<script src="//connect.facebook.com/en_US/sdk.js"></script>
<div id="fb-root"></div>
<script>
FB.init({
appId: '3xxxxxxxxx',
version: 'v2.2',
channelUrl : 'http://www.gohella.com/channel.html', // Channel File
oauth : true,
cookie: true,
status: true,
xfbml: true
});
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
window.location = "home.html";
}
});
FB.Event.subscribe('auth.login', function () {
window.location = "home.html";
});
// Load the SDK asynchronously
(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_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
// Here we run a very simple test of the Graph API after login is
// successful. See statusChangeCallback() for when this call is made.
function testAPI() {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Successful login for: ' + response.name);
document.getElementById('status').innerHTML =
'Thanks for logging in, ' + response.name + '!';
});
}
</script>
这是我的按钮代码......
<fb:login-button size="xlarge" autologoutlink="true" scope="public_profile, user_friends" onlogin="checkLoginState();">Log In</fb:login-button>
有什么建议吗?