0

I am creating an application. I want to access the friends list form Facebook in my app, but i am unable to access the Facebook friends list in my app. All others thinks are accessible, only friend list is not accessible. I have an old app id in which i access all the friends but in my new app id i am unable to access the friend list. In my app, I mention the following permissions: 1. Public_Profiles 2. basic_info 3. user_photos 4. user friends 5. read_friendslist

if any others permissions are needed then please let me know.

Prateek Sharma
  • 651
  • 9
  • 18
  • possible duplicate of [Android: get facebook friends list](http://stackoverflow.com/questions/6236251/android-get-facebook-friends-list) – Pratik Butani May 29 '14 at 07:16

2 Answers2

0

You new app is using API v2.0 and in API v2.0 you can not get all friends. /me/friends will only return friends that are also using the app.

There are some new APIs added in v2.0 that you may be able to use: taggable_friends, invitable_friends and social context.

WizKid
  • 4,888
  • 2
  • 23
  • 23
  • with taggable_friends i got id.name.picture. here i am trying to use friend id to get my friend's friend list. but this id is not accessible to get my friend's friends list. – Prateek Sharma May 30 '14 at 05:37
  • That is correct. Taggable_friends you use to get friends to tag. Not to get friend's friends list. You can't get friend's friends list – WizKid May 30 '14 at 05:38
0

I am getting friends list in two ways:

  1. `Session activeSession = Session.getActiveSession(); if (activeSession.getState().isOpened()) {

        Request friendRequest = Request.newMyFriendsRequest(activeSession,
                new GraphUserListCallback() {
                    @Override
                    public void onCompleted(List<GraphUser> users,
                            Response response) {
    
                        UsefullData.Log("Response : " + response.toString());
                        UsefullData.Log("Friends list" + users);
                        //setUserFriendsList(users);
                    }
                });
        Bundle params = new Bundle();
        params.putString("fields", "id, name, picture");
        friendRequest.setParameters(params);
        friendRequest.executeAsync();
    
    }`
    
  2. Request friendRequest = new Request( activeSession, "/me/friends", null, HttpMethod.GET, new Request.Callback() { public void onCompleted(Response response) { UsefullData.Log("Friends Response : " + response.toString()); //setUserFriendsList(response); } } );friendRequest.executeAsync();

Note: set custome permission "user_friends" in your session. both codes are working at my end. I hope it will help for you.

Yogendra
  • 4,817
  • 1
  • 28
  • 21