Kirankumar Dafda
Kirankumar Dafda

Reputation: 2384

How to get facebook friends list using JavaScript

I have tried

FB.api('/me/taggable_friends?limit=500', function(response) {
    alert(JSON.stringify(response));
}

Which gives me only administrators fb friends list

For other fb users - below error message

To use taggable_friends on behalf of people who are not admins, developers and testers of your app, your use of this endpoint must be reviewed and approved by Facebook. To submit this feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review

As I have already submitted my app for review and below is a screenshot that showing that I have an access of Friend List

enter image description here

If I use Facebook Developer Link for friend list then I don't know how to get and set "/{friend-list-id}"

/* make the API call */
FB.api(
    "/{friend-list-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);

Please let me know if is there any working example for this or this is possible or not.

Upvotes: 0

Views: 2530

Answers (1)

andyrandy
andyrandy

Reputation: 74014

You have to get taggable_friends approved by Facebook, else it will only work for users with a role in the App. Don´t mistake this with user_friends and the /me/friends endpoint. that one you don´t need to get approved, but you only get friends who authorized your App with /me/friends.

In your App Settings, click on "App Review", then on "Start a Submission". Scroll down to "Taggable Friends".

Btw, you have to finish your App or at least create a working prototype, BEFORE you can send something in for review.

Upvotes: 1

Related Questions