我想确定两个用户(都使用我的应用程序)是否有共同的朋友。用户的姓名/数据无关紧要,共同朋友的数量无关紧要。我只需要两个人在 Facebook 上是否有共同的朋友。共同的朋友可能没有使用该应用程序,但两端都在使用我的应用程序。这些在 Graph API 1.0 中非常简单,但我想知道在 Graph API 2.0 或 2.1 中是否可以通过任何方式实现我想要实现的目标?
问问题
898 次
2 回答
1
使用mutual_friends API。https://developers.facebook.com/docs/graph-api/reference/v2.1/user.context/mutual_friends解释了如何使用它
于 2014-10-27T16:53:18.320 回答
1
抱歉,用户 A 和 B 必须是好友才能使用
/v.2.2/{user-id}?fields=context.fields(mutual_friends)
检查他们共同的朋友(例如 C、D、E、F...)
正如@WizKid 所说,我使用以下示例进行了双重检查:
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
于 2015-03-10T11:20:36.983 回答