Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find Facebook Friends using the same app

I am creating an app and would like people using the app to find friends using the same app on Facebook. Any help on this would be great.

I know this can be done. I have seen it on Instagram and Tiger Woods 12.

like image 282
iamsmug Avatar asked Dec 12 '11 13:12

iamsmug


1 Answers

Once you've authorised the user and obtained an access token, you can quickly determine which of their friends have already authorised your app with a call to /me/friends?fields=installed

For the users' friends who have already authorised the app, the result will look like this:

{
   "installed": true, 
   "id": "{USER_ID_GOES_HERE}"
}, 

and for the users who have not already authorised the app, the result will look like this:

{
  "id": "{USER_ID_GOES_HERE}"
}, 

If you're doing this in the iOS SDK you won't see that exact return value, but the SDK should put the results into a data structure you can use, and check for the presence of the 'installed' item

You can also request additional User object fields other than just 'installed', but this is just a quick example to show you how to get the list of friends that use the app

like image 96
Igy Avatar answered Sep 23 '22 19:09

Igy