2

My permissions:

facebookLoginButton.setReadPermissions(
    Arrays.asList("public_profile", "user_friends","read_friendlists"));

Callback functions:

new Request(Session.getActiveSession(), "/" + USER_ID + "/friends", null, HttpMethod.GET,
    new Request.Callback() {
        public void onCompleted(Response response) {
            showLogInfo("###########" + response.getRawResponse());
        }
    }).executeAsync();

This above function I'm calling to get facebook friends list. but I'm getting following response.

{"summary":{"total_count":342},"data":[]}

My doubt is I'm getting total count. but why can't I get data list ? Please someone help me to Identify my mistake. Thanks in Advance.

pgiecek
  • 7,970
  • 4
  • 39
  • 47

2 Answers2

3

It is not possible to get ALL friends with v2.0+, only with Apps created before end of April 2014 by using v1.0 of the Graph API. And it will only work until end of April 2015. See changelog for more information about the versions: https://developers.facebook.com/docs/apps/changelog

There is also invitable_friends and taggable_friends though, but they are reserved for Apps on facebook.com:

This may also be interesting for inviting friends: https://developers.facebook.com/docs/games/requests/v2.1

Here´s another thread where this is explained in a very detailed way: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Hi luschn. Thanks for your answer, I tried that. But I got only friends list who are installed my app. But I want to take all friends list especially who are not installed. Because I need to take their mailID or USER_ID . then i can invite them. PLEASE HELP ME TO GET FRIENDS USER_ID LIST. THANK YOU FRIENDS. – Praveen Kumar Sugumaran Oct 15 '14 at 05:48
  • if you want to invite users, take a look at "invitable_friends". – andyrandy Oct 15 '14 at 07:44
  • Hai luschn, I tried invitable_friends. By using that I'm getting all friends name with temporary tokenID. I need all friends' USER_ID. We can't use temporary ID. we can't use that ID to identify our friends. – Praveen Kumar Sugumaran Oct 15 '14 at 14:56
  • you are not supposed to get all friends just for identifying them. invitable_friends is for inviting in facebook games only. – andyrandy Oct 15 '14 at 15:03
2

New facebook graph api does not allow friend list access, you can only get count and Tagged friends

Check this link developers.facebook.com/docs/graph-api/reference/v2.1/user/ where it is clearly mentioned that

  • This will only return any friends who have used (via Facebook Login) the app making the request.

  • If a friend of the person declines the user_friends permission, that friend will not show up in the friend list for this person

Suhail Mehta
  • 5,514
  • 2
  • 23
  • 37