登录时未从Facebook API获取电子邮件 [英] Not getting email from facebook API while login

查看:107
本文介绍了登录时未从Facebook API获取电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在登录时遇到问题,即使在向用户&用户添加电子邮件时也无法收到电子邮件朋友权限(对于某些Facebook帐户).

I have a problem while login i can't get email even while adding email to User & Friend Permissions (for some facebook accounts).

我正在使用facebook-php-sdk,这是我正在使用的代码

i'm using facebook-php-sdk, this the code that im using

$facebook_user_profile = $facebook->api('/me', array('fields' => 'id,email,first_name,last_name,picture'));

$facebook_user_profile = $facebook->api('/me', array('fields' => 'id,email,first_name,last_name,picture'));

请问有人可以救我吗?

推荐答案

除了CBroe评论有关登录时获取"ascope ="https://developers.facebook时使用"scope"参数请求权限的内容.com/docs/reference/login/#permissions>权限,您还必须考虑以下事实:并非每个登录用户(或允许您的应用程序访问其信息的用户)都为自己的帐户分配了电子邮件.

Apart from what CBroe commented about asking for the permissions using the "scope" parameter while logging in to grab permissions, you must also consider the fact that not every logged in user (or a user allowing your application to access their info) has an email assigned to their account.

一个人可以使用其手机号码来验证其Facebook帐户,因此不存在电子邮件的可能性.因此,在开发应用程序时,要考虑到用户是否没有电子邮件,那么您应该在登录后通过表格手动请求它(如果用户使用您的应用程序,则电子邮件是必需的).

one can verify their facebook accounts using their Mobile numbers, hence the probability that no email exists. Therefore, when developing an application, take into consideration if a user does not have an email, then you should ask for it manually through a form after login (this is IF the email is necessary for users to use your app).

希望此信息对您有所帮助!

hope this info helps!

这篇关于登录时未从Facebook API获取电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆