Facebook朋友电邮FQL [英] Facebook friends email 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
result: p>
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.
推荐答案
一般来说,你无法获取您的朋友的电子邮件地址(来源):
In general, you CAN'T get the email address of your friends (source):
User permission Friends permission
email not available
但是,但是由于您的朋友授权您的应用程序,您可以在 FQL控制台:
BUT but since your friend has authorized your application, you can try the following in the FQL console:
SELECT email FROM user WHERE uid=FRIEND_ID
我怀疑问题可能是你需要朋友的 access_token
实际获取电子邮件,因为我想您在尝试您的用户时登录为 查询。因此,您需要授予 offline_access
权限,然后将其与查询一起使用。
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 the offline_access
permission and then use it with the query.
但在进行上述操作之前,我将尝试使用应用程序 access_token
。
But before doing the above, I would try it with an application access_token
.
P.S:如果您知道朋友ID,则不需要子查询。
P.S: the sub-query is not needed if you know the friend id.
这篇关于Facebook朋友电邮FQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!