我只是想设置 Facebook Connect 以允许在我已经建立的网站上选择使用注册表单进行注册,或者使用 Facebook Connect 进行注册(这真的应该比现在更容易,过时的文档让我发疯了)。当用户单击按钮时,它会打开弹出窗口并要求允许我正确询问的内容。但是,当他们单击允许时,它会再次要求允许(但只是基本的个人资料信息)。这显然是由单击 fb:login 按钮的默认操作触发的,即使他们已经登录并允许应用程序访问他们的数据。
<fb:login-button size="medium" length="long" v="2" onclick="fb_login()"></fb:login-button>
<div id="fb-root"></div>
<script src="http://static.ak.fbcdn.net/connect/en_US/core.js"></script>
<script>
FB.init({appId: '<app_id>', status: true, cookie: true, xfbml: true});
function fb_login() {
FB.login(function(response) {
if (response.session) {
if (response.perms) {
// they have allowed the app, continue with registration
}
}
}, {perms:'email,user_birthday'});
}
</script>