Facebook 好友发送电子邮件 FQL
我有这个 FQL:
$femail = $facebook->api(array(
'method' => 'fql.query',
'locale' => 'en_US',
'query' =>
'SELECT email
FROM user
WHERE uid
IN (SELECT uid2
FROM friend
WHERE uid1='.$user_id.')
AND uid = '.$friend_id.'
ORDER BY name ASC', ));
这是 print_r
结果:
Array
(
[0] => Array
(
[email] =>
)
)
我想获取朋友的电子邮件地址,但此查询会产生空电子邮件值。我是否错过了查询中的某些内容?甚至可以收到朋友的电子邮件吗?我和我的伴侣进行了测试,她允许该应用程序提供电子邮件地址。
I have this FQL:
$femail = $facebook->api(array(
'method' => 'fql.query',
'locale' => 'en_US',
'query' =>
'SELECT email
FROM user
WHERE uid
IN (SELECT uid2
FROM friend
WHERE uid1='.$user_id.')
AND uid = '.$friend_id.'
ORDER BY name ASC', ));
Here is the print_r
result:
Array
(
[0] => Array
(
[email] =>
)
)
I want to get friend's email address, but this query results in empty email values. Does I miss something in query? Does it even possible to get friends email? I tested with my partner, she gave permission to the app to give out email address.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般来说,您无法获取朋友的电子邮件地址 (来源):
但是但是由于您的朋友已授权您的应用程序,您可以在 FQL 控制台:
我怀疑问题可能是您需要“朋友的”
access_token
实际收到电子邮件,因为我认为您在尝试查询时以您的用户身份登录。因此,您需要授予offline_access
权限,然后将其与查询一起使用。但在执行上述操作之前,我会使用应用程序
access_token
进行尝试。PS:如果您知道好友 ID,则不需要子查询。
In general, you CAN'T get the email address of your friends (source):
BUT but since your friend has authorized your application, you can try the following in the FQL console:
What I suspect the problem could be is that you need the "friend's"
access_token
to actually get the email because I suppose you are logged-in as your user when trying your query. So you need to grant theoffline_access
permission and then use it with the query.But before doing the above, I would try it with an application
access_token
.P.S: the sub-query is not needed if you know the friend id.
您无法获取朋友的电子邮件地址。每个帐户必须选择与应用程序共享其电子邮件地址。朋友不能选择其他朋友加入,这是一件好事。
另外,正如 @Barkermn01 提到的,删除 AND uid = '.$friend_id'。
You can't get email addresses of friends. Each account must opt-in to sharing their email address with the application. Friends can't opt other friends in, which is a good thing.
Also, as @Barkermn01 mentioned, drop the AND uid = '.$friend_id.'