我正在使用 JS SDK 开发 Facebook 应用程序。在 FF/Chrome/Safari 上一切正常,除了无法加载 SDK 的 iPad 上。
我尝试使用非常简单的代码(大部分代码直接来自 Facebook 的文档),如下所示:
<!doctype html>
<html>
<head>
</head>
<body>
<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
/* All Facebook functions should be included
in this function, or at least initiated from here */
window.fbAsyncInit = function() {
FB.init({appId: MYAPPID,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
</div>
什么都没有出现。没有弹出窗口(它们没有被阻止),没有console.log,什么都没有。是我的代码有问题还是 Facebook SDK 今天发疯了?我在平台状态上没有看到任何相关内容。