-1

Since facebook has upgraded their api version according to v2.2 no fql query will be use I want to fetch friendlist of user (just name and birthdate) but while fetching the data using

 FB.api("/me/friends",function (response) {
            if (response && !response.error) {
                /* handle the result */
                console.log(response);
            }
        }
    );

}

enter image description here

now from above code its giving me only no of friends in count variable but in array of data variable is blank.

Kara
  • 6,115
  • 16
  • 50
  • 57
Md Shoaib Alam
  • 340
  • 1
  • 3
  • 13
  • 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-u) – Tobi Jan 05 '15 at 08:20
  • its not duplicate sir , facebook graph api has upgraded ,,,so please help me to solve ,,, – Md Shoaib Alam Jan 05 '15 at 08:57
  • It's the same question you're having. – Tobi Jan 05 '15 at 08:58
  • no sir this is not my problem , i want user friends data like birthday date and name which will be fetch in data[] varriable its not the case that user friends will use my app although i m getting blank value in data[] varriable ....please sir help me to resolve ,,,may be i am syntactically missing some thing ,,,,please . – Md Shoaib Alam Jan 05 '15 at 09:04

2 Answers2

3

You're not able to get all friends anymore, only the friends which are also using the same app. Furthermore, since the introduction of the Graph API v2.0, all friends_* permissions have been removed.

See

/me/friends returns the user's friends who are also using your app In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.

Tobi
  • 31,405
  • 8
  • 58
  • 90
0

The /me/friends will not return the array of friends as in the earlier Apis. Now this path request only returns the friends of the user which uses the current app. https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids https://developers.facebook.com/docs/apps/changelog#v2_0_permissions

If you need to fetch the friends for mentioning them or full list of friends with there pics and tokens. Use- /me/taggable_friends instead. This will return the list of all the friends of the user but there is a different set of parameters that they return.

You will not get the ids of the friends. You will only get an 'app specific user token' for each user. You will have to use that for all places. An eg for this is as below:

[1] => stdClass (
  [id] => {LONG_ALPHA_NUMERIC_STRING>},
  [name] => {FULL_NAME},
  [picture] => stdClass (
     [data] => stdClass Object (
        [is_silhouette] => ,
        [url] => {USER_ICON_URL})))
reVerse
  • 35,075
  • 22
  • 89
  • 84
Puneet Sethi
  • 85
  • 1
  • 1
  • 5