Facebook friends email FQL

前端 未结 2 496
名媛妹妹
名媛妹妹 2020-12-20 05:12

I have this FQL:

$femail = $facebook->api(array( 
\'method\' => \'fql.query\', 
\'locale\' => \'en_US\',
\'query\' => 
\'SELECT email 
FROM user          


        
2条回答
  •  太阳男子
    2020-12-20 05:30

    In general, you CAN'T get the email address of your friends (source):

    User permission     Friends permission
    email             not available
    

    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
    

    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.

    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.

提交回复
热议问题