Arun Sharma
Arun Sharma

Reputation: 11

Facebook APP [and js api] not showing any of the friends

I am trying to create a facebook web app, but am unable to get any of the friends through facebook javascript API. What I basically want my app to do is that it will ask a user to login and then after authorization, his/her all the friends{weather using the app or not} should be displayed.

Is it possible to get friends who don't use the app at all? If so, please tell me how! :)

img : http://postimg.org/image/9r959i38n/

code in my app:

FB.api('/me/friends',function(res){
   console.log(res.data[0].name); //just sample output
});

Thanks

Upvotes: 1

Views: 240

Answers (3)

Adam Azad
Adam Azad

Reputation: 11297

With the release of version 2.0 of the API,

In Graph API v2.0, access to /me/friends is no longer part of the default (public_profile) permissions. We now require you to ask for the new permission user_friends. With this permission, /me/friends now returns the person's friends who are also using the app.

https://developers.facebook.com/docs/apps/changelog#v2_0_permissions

Solution (temporary)

You can use version 1.0 till April 30th 2016.

http://graph.facebook.com/v1.0/

Opinion: This change will put an end for spam apps

Upvotes: 0

Sean Kinsey
Sean Kinsey

Reputation: 38046

/me/friends now only returns friends who are also using your app - https://developers.intern.facebook.com/docs/apps/changelog#v2_0_graph_api

See the full document for new APIs that might solve your problem instead.

Upvotes: 13

Related Questions