我试图使用Facebook的API,提供first_name,last_name,gender,email,birthday在我的网站上注册.我使用了Graph API并生成了具有必要范围的访问令牌.我尝试在我创建应用程序的个人帐户中正确返回字段,但对于FB测试用户和朋友的帐户,它返回电子邮件和生日为"未定义".在graph.facebook.com中,它显示了朋友帐户的以下错误.

Facebook在doulingo上返回我朋友的同一帐户的电子邮件ID.
我是否错误地设置了权限,还是有任何其他问题?
我想获取用户ID,姓名,电子邮件.获取ID和姓名但不是电子邮件.我有这个代码:
<html>
<head></head>
body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxx',
status : true,
cookie : true,
xfbml : true
});
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected') {
testAPI();
} else if (response.status === 'not_authorized') {
FB.login();
} else {
FB.login();
}
});
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function testAPI() {
FB.api('/me', …Run Code Online (Sandbox Code Playgroud)