我正在研究 facebook OAuth。我能够从 Facebook 帐户收到一些电子邮件,但其中一些却收不到。
可能是什么问题。
function login() {
FB.init({
appId: '<%=ConfigurationManager.AppSettings["facebookAPI"].ToString() %>',
cookie: true,
status: true, xfbml: true
});
FB.login(function (response) {
//alert("login");
//if (response.session) {
if (response) {
//alert(response);
//alert("login");
var url = '/me?fields=name,email';
FB.api(url, function (response) {
//var image = 'http://graph.facebook.com/' + response.id + '/picture';
// alert(response.name);
//alert(response.email);
$.ajax({
type: "POST",
url: "Login.aspx/SaveFacebookAutoSignUp",
data: "{ 'Name':'" + response.name + "', 'EmailId': '" + response.email + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
// alert("You have successfully sign in.Please Wait, we redirect you in a second.");
window.location = '<%=ConfigurationManager.AppSettings["weburl"].ToString() %>' + "OAuth.aspx?userId=" + data.d;
}
});
});
}
});
}
请查看代码,这就是我所做的,可能是什么问题?
如果需要更多详细信息,请告诉我。
最佳答案
电子邮件详细信息是根据用户的隐私设置提供的。如果用户将其电子邮件地址设置为不公开,则 Facebook 不会获取此类数据。
这一切都基于权限和隐私设置。
关于facebook - 无法从 facebook OAuth 获取所有电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9747978/