3

I am creating a quick test application with the facebook javascript sdk. I want to get the list of friends that also use this app. Since the app is in development mode, I figured I needed to do this with test users. I have created two test users (and the default test user), gave them the user_friends permission, and authorized the app for their accounts. UPDATE: All test users are friends with each other.

When logged into any one of the test users described above (login tested with call to get /me), I still get back nothing in response.

Here is my get friends function with the API call:

var getMyFriends = function(){
  FB.api(
      "/me/friends",
      function (response) {
        if (response && !response.error) {
          console.log(response);
        }
      }
  );
};

Here is my response object in the console:

Object {data: Array[0]}
data:Array[0] length:0

I got some pointers from this earlier post: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

Any thoughts on what I might be missing?

Community
  • 1
  • 1
Millie Walsh
  • 179
  • 1
  • 6
  • You can try to request `/me` and see what profile it is in response. Facebook API has provision for development profile, which means you app would have a dummy user to test it. If profile in `me` is test profile then it is obvious that empty set dummy set will be returned. – Pankaj Aug 29 '16 at 04:23
  • _Are_ the test users actually friends? (That’s an option you can select when creating them; probably also possible to make them friends later via the app dashboard.) – CBroe Aug 29 '16 at 08:26
  • @Pankj - Already done and it is correctly logged in as the expected user. – Millie Walsh Aug 29 '16 at 12:52
  • @CBore - Good question. Yes the test users are all friends with each other. I will edit the question to reflect this. – Millie Walsh Aug 29 '16 at 12:53

0 Answers0