0

I am building an app that is intended to work as a directory of people who work for the same org, we all have Facebook in common so it seemed easy to make this to get us together. I have a question though, how can I get their info for testing before actually deploying the app? I was reading on Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app and noticed that it's not allowed easily or at all. Am I wrong?

Right now I have:

function getFriends() {
    FB.api('/me/friends', function(response) {
      console.log('Friends response', response);
        if(response.data) {
            $.each(response.data,function(index,friend) {
                alert(friend.name + ' has id:' + friend.id);
            });
        } else {
            console("Error!");
        }
    });
}

but I get the empty Array, is there anything I could do?

Community
  • 1
  • 1
Tsundoku
  • 9,104
  • 29
  • 93
  • 127
  • possible duplicate of [Facebook Graph Api v2.0 me/friends returns empty, or only friends who also use my app](http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-use-m) – Sahil Mittal Jun 19 '14 at 06:02

1 Answers1

0

You have to ask for the user_friends permission.

This permission grants the app permission to read a list of this person's friends who also use your app. If any of this person's friends have chosen not to share their list of friends with your app, they will not show up in the list of friends for this person. Both people must have enable the user_friends permission enabled for a friend to show up in either friend list.

Matt
  • 74,352
  • 26
  • 153
  • 180
  • 1
    This question is being automatically flagged as low quality does to its length. To avoid deletion can you elaborate and provide citations? – Popnoodles Jun 05 '14 at 19:51