-1

In my app, i am trying to show profile pic and name of friends of the person logged in using the app. But, error occurs

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

My code is:

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
  }
 });
}

How can i solve this? please help.

This code works when i change "friends.getAppUsers" to "friends". I get all friends with their profile pic and name.

Thanks in advance.

Erma Isabel
  • 1,977
  • 8
  • 32
  • 63

1 Answers1

1

friends.getAppUsers is the name of a method from the old, deprecated, unsupported API

There's two answers here ( Facebook 'Friends.getAppUsers' using Graph API ) showing how to fetch the same data in the Graph Api or FQL

/me/friends?fields=X,Y,Z,installed will return whichever fields you need, and an extra field, installed which tells you if the user has already authorised your app

Igy
  • 43,312
  • 8
  • 86
  • 115
  • Then that friend hasn't installed the app - did you read the answers i linked? Only the friends who installed the app will have 'installed' in the response – Igy Dec 15 '12 at 15:34
  • Thnks. workd. Am sorry to bother u again. I am new to this. So, silly doubt. No one can login to the app, except the ones developed and got added via "insight users".Why is that? If any1 else try to login. Error Message "Error occured. Try again later" – Erma Isabel Dec 17 '12 at 05:35
  • 1
    Never mind got it.. It was about sandbox testing.. got it working – Erma Isabel Dec 17 '12 at 11:51