-1

私のアプリでは、アプリを使用してログインしている人のプロフィール写真と友達の名前を表示しようとしています。しかし、エラーが発生します

FB._callbacks.__gcb1({"error":{"message":"Unknown path components: \/friends.getAppUsers","type":"OAuthException","code":2500}});

私のコードは次のとおりです。

function loadFriends() {
//get array of friends
FB.api('/me/friends.getAppUsers', function (response) {
    console.log(response);
    var divContainer = $('.facebook-friends');
    var html = "";
    for (i = 0; i < response.data.length; i = i + 4) {
    // code to bind profile pic of friends using the app and their names
  }
 });
}

どうすればこれを解決できますか? 助けてください。

このコードは、「friends.getAppUsers」を「friends」に変更すると機能します。プロフィール写真と名前ですべての友達を取得します。

前もって感謝します。

4

1 に答える 1

1

friends.getAppUsersは、廃止された、サポートされていない古いAPIのメソッドの名前です。

ここには2つの答えがあり(Facebookの「Friends.getAppUsers」はGraph APIを使用)、GraphApiまたはFQLで同じデータをフェッチする方法を示しています。

/me/friends?fields=X,Y,Z,installedinstalled必要なフィールドと、ユーザーがアプリを既に承認しているかどうかを示す追加のフィールドが返されます

于 2012-12-13T15:49:40.190 に答える