Facebook 登录用户如何使用 asp.net 检索用户数据
facebook login how user retrieve user data with asp.net
我尝试获取用户 ID、姓名、电子邮件。
我的代码用于登录和注销。我得到登录名,但缺少一些东西。
当我更改为 response.name 时,为什么不能使用 response.e-mail 或 response.id
测试 api 工作,但我需要电子邮件和用户 ID 请帮助
function testAPI() {
FB.api('/me', function (response) {
document.getElementById('status').innerHTML = response.name ;
});
}
这是我的登录按钮代码:
<fb:login-button scope="public_profile,email" onlogin="checkLoginState(); data-max-rows="1" data-size="medium" data-show-faces="true" data-auto-logout-link="true"">
</fb:login-button>
<div id="status">
</div>
我解决了问题。我希望它能帮助别人
这是我的工作代码:
function testAPI() {
FB.api('/me', 'GET', { "fields": "id,name,picture,email" }, function (response) {
document.getElementById('status').innerHTML = response.email ;
});
}
我尝试获取用户 ID、姓名、电子邮件。 我的代码用于登录和注销。我得到登录名,但缺少一些东西。 当我更改为 response.name 时,为什么不能使用 response.e-mail 或 response.id 测试 api 工作,但我需要电子邮件和用户 ID 请帮助
function testAPI() {
FB.api('/me', function (response) {
document.getElementById('status').innerHTML = response.name ;
});
}
这是我的登录按钮代码:
<fb:login-button scope="public_profile,email" onlogin="checkLoginState(); data-max-rows="1" data-size="medium" data-show-faces="true" data-auto-logout-link="true"">
</fb:login-button>
<div id="status">
</div>
我解决了问题。我希望它能帮助别人 这是我的工作代码:
function testAPI() {
FB.api('/me', 'GET', { "fields": "id,name,picture,email" }, function (response) {
document.getElementById('status').innerHTML = response.email ;
});
}