Finding mutual friends on facebook

后端 未结 5 1421
执笔经年
执笔经年 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:16

    Managed to find a solution and it's working. If you got the call working within you and somebody else and you both are friends on Facebook, what you need to do is create the Appsecret

    which represents the App secret key found on Facebook Dev under My Apps and the token. You create this key by running : $appsecret_proof= hash_hmac('sha256', $access_token, $app_secret);

    Afterwards you pass the token and the secret as parameters to the call:

    Bundle params = new Bundle(); 
    params.putString("appsecret_proof", appsecret_proof); 
    params.putString("access_token", access_token);
    

提交回复
热议问题