电子邮件范围问题/电子邮件地址未在 /me 请求中发送
我正在使用 PHP SDK 3.1,并且在从 /me 请求检索电子邮件时遇到问题。 我的范围看起来像:
protected $scope = 'email,offline_access,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown';
并且我通过以下方式获取 url:
$this->fb->getLoginUrl(array('scope' => $this->scope));
其中 $this->fb 是 Facebook 实例。
问题是当我调用
$userProfile = $this->fb->api('/me');
变量 $userProfile 时包含大量数据但没有电子邮件。几天前它起作用了,但不知何故它停止了。
我应该怎么做才能收到电子邮件?
谢谢指教。
I'm using PHP SDK 3.1 and I have a problem with retrieving email from /me request.
My scope looks like:
protected $scope = 'email,offline_access,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown';
and I'm getting url by:
$this->fb->getLoginUrl(array('scope' => $this->scope));
where $this->fb is an Facebook instance.
Problem is when i call
$userProfile = $this->fb->api('/me');
Variable $userProfile contains a lot of data but there is no email. Few days ago it worked but somehow it stopped.
What should i do to get email?
Thanks in advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在使用相同的套件和以下内容,效果很好。
user_about_me
应该不是必需的。$loginUrl = $facebook->getLoginUrl( array('scope' => 'user_about_me,email' ) );
注意:如果您没有预先授予权限,请尝试重新授权应用程序对于用户来说。
I'm using same kit and the following, works just fine.
user_about_me
should not be necessary.$loginUrl = $facebook->getLoginUrl( array('scope' => 'user_about_me,email' ) );
Nota : If you did not give the rights upfront, try re-authorizing the app for the user.
应该可以,但请记住,您只能获取连接的用户电子邮件,而不能获取他朋友的电子邮件
should work but remember that you can only get the connected user email and not his friends emails