Retrieve user's friends who like the same fan

2019-07-06 03:23发布

I try to find facebook api to retrieve user's friends who like the same fan page but I dont think the new graph api able to do this.

While searching in the stackoverflow, I came out with this FQL:

select user_id from like where object_id = "[page_id]" and user_id in (select uid2 from friend where uid1 = me())

but facebook return me with

array(0) {
}

is there any solution ?

1条回答
Juvenile、少年°
2楼-- · 2019-07-06 03:42

You can do this with FQL:

SELECT uid FROM page_fan 
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
    AND page_id = "[fan_page_id]"

Which returns you friends who are fans of given fan page ([fan_page_id]). It works at this moment quite well.

查看更多
登录 后发表回答