S
S
serious9112015-04-20 18:07:57
JavaScript
serious911, 2015-04-20 18:07:57

Get friends list via Facebook API?

Hello.
I am developing an application/game for Facebook. Faced the problem of displaying a list of friends in the application and posting them on the wall.
Using the method from the JS SDK, I get a list of friends:

FB.api("/me/invitable_friends", function (response) {});

Using this method, I want to post a notification on a friend's wall:

FB.ui({method: 'feed', to: friendId , href: APP_URL, function(response) {});

The problem is that through invitable_friends I get a list of friends to invite to the game with an ID of this type:

AVmT0LpyfvRMStEo2BW5seybtX1KbySRJtTb0wv0PqHVhT4sr7Le3

And the FB.ui({method: 'feed'}) method only works with regular user IDs 1409078876074289 and, accordingly, I can't post a message on a friend's wall.
There is also the FB.api('/me/friends/', function(response) {}) method, but for some reason it always returns an empty array.
Permissions contains the following parameters:

{scope: 'publish_actions,public_profile,email, user_friends '}

Please tell me how to get a list of friends with normal IDs.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
keu, 2015-04-21
@keu

Starting with version 2.0 of the GRAPH API, you can only get the list of friends who are using your application.
Quote from Facebook Platform Changelog :
There is simply no other way to get a list of friends.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question