Facebook Graph API 不会返回电子邮件地址 [英] Facebook Graph API won't return email address
问题描述
不重复,因为:
- 我有权限
- 调试令牌
- 代码适用于测试用户
请不要在未阅读的情况下将其标记为重复.
我正在尝试获取用户的电子邮件地址,但我没有获取到.在图形 API 资源管理器上,当我点击发送时,电子邮件字段变为灰色并显示:
I'm trying to get the user e-mail address, but i don't get it. On graph api explorer, when i hit send, email field becomes grayed and says that:
字段为空或被访问令牌禁止
field is empty or disallowed by access token
但是当我调试令牌时,它已授予电子邮件权限
我的个人资料有一个电子邮件地址.
My profile has an e-mail address.
更新:我尝试了 https://developers.facebook.com/tools/console/ .即使在另一台计算机上,我的个人资料也没有任何返回.但相同的代码返回另一个帐户的电子邮件、名称和 uid.
Update: I tried https://developers.facebook.com/tools/console/ . My profile returns nothing, even on another computer. But the same code returns the email, name and uid of another account.
代码:
<fb:login-button scope="email">
Grant Permissions to make more examples work
</fb:login-button>
<button onclick="doPost()">Post to Stream</button>
<script>
function userData() {
FB.api('/me?fields=name,email', Log.info.bind('/me callback'));
};
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
userData();
}
});
</script>
是否可以锁定您的电子邮件,让任何人都无法拥有它?即使我授予权限?
It is possible to lockdown you e-mail so no one can has it? Even when i grant permission?
推荐答案
在我将错误报告标记为重复并阅读那里的所有帖子和链接后,我了解了导致此问题的原因以及如何解决.
After i got my bug report marked as duplicate, and i read all posts and links there, i got what caused this problem for me and how to fix.
问题Facebook 似乎有时会忘记您在图形 API 上的主要电子邮件是什么(但它仍然存在于首选项中.)
The Problem Facebook seems to sometimes forget what your primary e-mail is on the graph API (But it still there in the preferences.)
解决方案受影响的用户必须删除电子邮件,保存设置,然后重新添加地址,重新确认,然后将其设为主要地址.这修复了我在沙盒应用和其他无法登录 Facebook 的应用上的帐户.
Solution The user affected must remove the e-mail, save settings, then re-add the address, re-confirm, then make it primary. This fixed my account both on my sandbox app, and other apps where Facebook login don't used to work.
这篇关于Facebook Graph API 不会返回电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!