Determining if two app using users have any mutual

2019-07-31 00:52发布

问题:

I want to determine if two users (both using my app) have any mutual friends in common. The names/data of the users are irrelevant, the number of the mutual friends is irrelevant. I just need if two people have any friends on Facebook in common or not. The mutual friends may not be using the app, but the two ends ARE using my app. These were pretty easy in Graph API 1.0, but I'm wondering if what I'm trying to achieve is possible by any means in Graph API 2.0 or 2.1?

回答1:

Use the mutual_friends API. How to use it is explained at https://developers.facebook.com/docs/graph-api/reference/v2.1/user.context/mutual_friends



回答2:

Sorry to say, user A & B have to be friends if you want to use

/v.2.2/{user-id}?fields=context.fields(mutual_friends)

to check their mutual friends (e.g. C,D,E,F...)

I had double checked as @WizKid said, with the following sample:

1. A & B are friends, run the mutual_friends Graph API call ===> Found
2. unfriend A & B, run the same mutual_friends Graph API call ===> No data
3. Be-friended A & B again, run same Graph API call ===> Found