When using the Facebook API to login to a website, can you pull a list of that user's friends who have logged in using the same app id?
2
votes
Not an expert with Facebook API but I quess if a user is using the same app, he/she has most likely accepted to share his/her profile and login info with the app, so the answer for short is YES.
- BudwiseЯ
You can record each user who logs into the app and then get the user's friends and see which of them have used the app before.
- Michael Mior
2 Answers
1
votes
I don't think that there's a Graph API method for this yet, there's a REST method though called friends.getAppUsers.
Now to do this without REST API there are a couple of ways, one of them:
- User login using Facebook => insert a new record in your
usertable if not exists - Retrieve the user's friends by calling the
/USER_ID/friendsconnection - Prepare a comma separated string of the user friends' ids to get the users (friends) from your
usertable:SELECT * FROM user WHERE user_fb_id IN ($friends_id)
0
votes
U can look here https://developers.facebook.com/docs/reference/rest/friends.get/ List the friends and show in your app if they are connected. But when it is not your app. I think you can't do it.