0

私と他の(私の友達ではない)ユーザーとの間のすべての共通の友達を取得しようとしています。

それを行うには、graph.facebook.com (REST クライアント) に接続する php サーバーを使用します。

ダッシュボードから AppSecret を使用しています 有効な access_token を送信しています (user_friends パーミッション付き) 有効な appsecret_proof を送信しています (ドキュメントに記載されている方法で作成):

$appsecret_proof = hash_hmac('sha256', $access_token, $secret);

appsecret_proof を変更すると、「API 引数に無効な appsecret_proof が指定されました」と表示されるので、正しく有効であると思います。

常に同じ応答を取得します:

 "error": {
       "message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
        "type": "GraphMethodException",
        "code": 100,
        "fbtrace_id": "XXXXXXXXXXX"
      }

これは私のコードです:

$appsecret_proof = hash_hmac('sha256', $access_token, $secret);

$url =  '/v2.5/'.$userID.'?fields=context.fields(all_mutual_friends)&appsecret_proof='.$appsecret_proof.'&access_token='.$access_token ;

$config = array('server'=> 'https://graph.facebook.com');
$this->CI->rest->initialize($config);
$result = $this->CI->rest->get($url);

共通の友達を取得するにはどうすればよいですか?

4

1 に答える 1