1

I would like to show mutual friends (Just a number X mutual friends - no other information) on a users profile who has signed up in an app I am working on.

We had planned to do this using the list of friends ID's however this is now not accessible since Facebook updated it's permissions around this.

Is there any way to do this now? I was looking at taggable_friends, would we be able to use this for that.

Thankyou

Tom
  • 37
  • 9

1 Answers1

2

Have a look at my answer at Fetch Facebook Mutual friends between me and another User

This should solve your question. The docs are here: https://developers.facebook.com/docs/graph-api/reference/v2.1/user.context/mutual_friends

Use the summary.total_count filed of the response to determine how many friends the two users have in common.

Community
  • 1
  • 1
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • That only works when both users are using the app. I want to show mutual facebook friends overall, not just ones that use the app. – Tom Aug 19 '14 at 11:56
  • As you want to show the number of mutual friends, at least you wrote that, you can use the `summary.total_count` field of the response. Quote: *The full count of friends in common, including those not using the app.* – Tobi Aug 19 '14 at 12:06
  • From what i can see total count is their total number of friends all together, not friends in common. – Tom Aug 19 '14 at 12:52
  • The docs say otherwise, and I just checked this with some of my friends data. Try requesting `/me/friends` first, and select a returned `user_id`. Use this `user_id` for the request: `/{user_id}?fields=context.fields(mutual_friends)` – Tobi Aug 19 '14 at 14:23
  • I don't know what you're doing differently, but when making these requests as an app they are restricted to friends that use the app. – Tom Aug 20 '14 at 08:31
  • You can't "make this request as an app", because it requires a user access token! – Tobi Aug 20 '14 at 08:34
  • Select one of your apps instead of graph API explorer on explorer and you'll see it just returns friends who use the app. – Tom Aug 20 '14 at 08:59
  • `/me/friends` does that, also with Graph Explorer. But that wasn't the question. You asked about mutual friends of two Facebook users, and I showed you a way of how to do that. The example with `/me/friends` was just to do a quick test. You can use two totally independant user_ids to get their mutual friends. And this itself works. – Tobi Aug 20 '14 at 11:45