Finding mutual friends on facebook

后端 未结 5 1449
执笔经年
执笔经年 2021-01-21 11:15

I want to find out mutual friends between two random users using the facebook Graph API v2.2.

I read through the documentation https://developers.facebook.com/docs/graph

5条回答
  •  灰色年华
    2021-01-21 11:24

    It's an old question but now I've dealt with it so I'll write...

    to get all mutual friends if you not his friend it's passible only from a server(in my case it's Node) as mention here: https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends/

    get the token of user-2 and YOUR auth-id, also generate appsecretProof and clientSecret from your Facebook admin panel of your app.

    https://graph.facebook.com/v2.10/${auth_userId}? 
    fields=context.fields%28all_mutual_friends.limit%28100%29%29 
    &appsecret_proof=${appsecretProof}&access_token=${accessToken}
    

    remember to ask permmision from users when they login and also send app review to Facebook to approve this feature.

    with 'user_friends' permissions you can get from client only mutual friends that use in your app but not all mutual friends.

提交回复
热议问题