How to get Mutual Friends via Facebook's Graph API

前端 未结 3 1048
醉话见心
醉话见心 2021-02-09 12:55

Is there anyway to get a list of mutual friends using Facebook\'s Graph API?

I\'ve been playing around with this tool and haven\'t yet figured out a way. However, I saw

3条回答
  •  太阳男子
    2021-02-09 13:42

    I would do this as a FQL query and test it with their FQL tester. This might not be 100% what you are looking for, but it should be enough to get you started:

       SELECT uid1, uid2 FROM friend 
       WHERE uid1 IN 
       (SELECT uid2 FROM friend WHERE uid1=me())
       AND uid2 IN 
       (SELECT uid2 FROM friend WHERE uid1=me())
    

    You could then look up these id's up against the user table.

提交回复
热议问题