Get facebook friends with Graph API v.2.0 [duplicate]
Asked Answered
R

1

62

A while ago, I used to take the friends of mine using Graph API in this way (using Graph API Explorer):

/me/friends

Everything was perfect but now, with 2.0 version, I saw that this way does not function for friends who didn't use (via Facebook Login) the app making the request and, if I switch Graph API Explorer to 1.0 version, it functions.

So, how can I do the same thing with the 2.0 version?

Refurbish answered 1/5, 2014 at 0:13 Comment(16)
You can’t – the whole point of these changes is to expose less data and give users more privacy. developers.facebook.com/docs/apps/changelog: Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.”Immoderation
And when the old version of graph api will be deleted?Refurbish
developers.facebook.com/docs/apps/versionsImmoderation
well... this is really a bad news! Thank you anyway!Refurbish
No, it’s good news – it keeps apps from getting to much data into their hands.Immoderation
@Immoderation it's also mean we don't get friend's posts in the news feeds ? (if they dont sign in to the app)Tabes
@CBRoe It's bad news because it's a false good idea which will lead to more chaos. How long before applications start to ask username and password to retrieve data they can't retrieve by OAuth? And other new dirty strategies will arise: a bookmarklet or a browser add-on can probably aspirate content while user is connected to Facebook. Facebook decision defeats OAuth goal: providing a clean and controllable way of allowing an application to act in user's behalf.Hamfurd
ok, I test with graph explorer v2.0 and you can get friends post on news feeds, but not the friends timeline. I can understand why facebook wants to protect the users data from the apps, but..I wish the could find smart way to let developer show the data to the clients, without send it to other servers. I wonder what will happen to all the facebook clients apps now. this is crazy.Tabes
completely agree with SmartLove and user1105951Refurbish
I have opened issue on the Facebook Graph API - help by subscribing and opening related issues: developers.facebook.com/bugs/1502515636638396Bearberry
“I have opened issue on the Facebook Graph API” – OK, you needed to hear that it’s by design officially, fair enough …Immoderation
No, I needed to report a RFE request. The current API is too limited for some non-malicious use-cases.Bearberry
I agree with Petr (joshis), many non-malicious use-cases are now not realizable (with no workaround) and will cause end of many useful applications if FB doesn't change API.Realpolitik
Please select Simon Cross's answer as the right one.Calliper
Sign the petition for API change: change.org/petitions/…Realpolitik
Hi Giacomo, can you please help how to get all friends list from facebook graph api. It just giving few friends list only.Berthaberthe
I
109

In v2.0 of the API, /me/friends returns friends who also have logged into the app.

Apps created on or after April 30th 2014 must use Graph API v2.0; they're not able to call Graph API v1.0.

For apps which were active before April 30th, these apps can call either Graph API v2.0 or Graph API v1.0, but Graph API v1.0 will be deprecated on April 30th 2015.

Note that if a user logs into an app via v2.0, and you call /v1.0/me/friends, this will still only return app-using friends.

If you want to access non-app-using friends in the case where you want to let your users tag people in stories you publish to Facebook, you can use the /me/taggable_friends API.

In the case where you want to invite people to use your app, Games can use the /me/invitable_friends endpoint in order to render a custom invite selector. The tokens returned by this API can then be used in the Requests Dialog. See https://developers.facebook.com/docs/games/invitable-friends/v2.0 and https://developers.facebook.com/docs/games/requests/v2.0

For non-games wanting allow people to invite friends to use an app, you can still use the Send Dialog on Web or the Message Dialog on iOS and Android

Inductile answered 1/5, 2014 at 21:22 Comment(17)
How about for non-games?Patrizius
And many,many apps will die.That sucks.In so many ways.Misericord
For non-games wanting allow people to invite friends to use an app, you should use the Send Dialog on Web or the Message Dialog on iOS and Android. These dialogs allow the user to select any of their friends - including those who don't us the app.Inductile
Great answer! too bad I found it only now after researching for the last 5 hours.Calliper
For non-games, that sucks really bad. The user will NEVER type in all their friends name to send them a message.Rossanarosse
Good to know -- I've been looking for a definitive answer on this for a while. Worth finding a corner of SO where we have some agreement. I'll stop looking for a loophole now.Aerosol
Wait this is unclear to me - If we have an app created before April 30 2014, does this mean we still have access to the friends list?Reisch
@Oscar, it depends. Your app had to have been active before April 30th 2014. If your app was not making API calls before April 30th 2014, it will have also been upgraded to use v2.0 and will behave just like any app created after April 30th 2014. For apps which were active before April 30th 2014, you can call API v1.0 until April 30th 2015 after which point v1.0 will be deprecated for all apps.Inductile
What if our app simply wants to display the events their friends are going to? Like a calendar? And not have them invite anyone?Mastaba
@GregoryMagarshak - this is no longer possible in v2.0 and above. The background here is that Facebook heard clear feedback from users that people felt uncomfortable that a friend could pass their own information to apps - which would be required in this use case. From v2.0 onwards, Facebook Login is about people granting access to their own information, not that person's friends' information.Inductile
What about FQL, perhaps that still works as before in v2.0 ? Are you sure?Mastaba
What is disgusting about this is that apps like Pinterest blew up because they were able to shove inviting your Facebook friends down your throat in clean UI, and they still do! Yet new apps and from hence forth no new social networks or ideas can do the same? That's foul, almost a monopolistic move so no one else can use Facebook as an invitation tool. Terrible decision.Sponson
Because Pinterest, and others, existed before April 30, 2014, they have until April 30, 2015 to upgrade to API v2.0 or greater.Inductile
just one more reason why I HATE facebook ....Blocked
Sorry to hear that @SamBInductile
Now, you can't wish birthday to your friends using scripts :(Merlinmerlina
Is there any way to get friends list who haven't allowed application yet with new api ? Or I should send invitation for them ?Emelineemelita

© 2022 - 2024 — McMap. All rights reserved.