0

I implemented facebook in my application using spring social facebook. Its connecting and also getting all details of user..now i want friendslist of user who connected to facebook. Using getFriendProfiles() from facebook GraphApi its working but its retuns only those friends who uses our app...But i want all friends irrespective of they use our app or no...

this is my code:

 OAuthInfo oAuthInfo = new OAuthInfo();
    Facebook facebook = new FacebookTemplate(connection.createData().getAccessToken());
                List<String> friendIds = facebook.friendOperations().getFriendIds();
               PagedList<FacebookProfile> friends = facebook.friendOperations().getFriendProfiles();
               PagedList<FamilyMember> family=facebook.friendOperations().getFamily();       

                  oAuthInfo.setFriends(friendIds);     
                  oAuthInfo.setFriendsDetails(friends);
                  oAuthRepo.save(oAuthInfo);

Using Facebook version 2.0.0.M1. Please help ..how to get all friends list .

Jayashree
  • 107
  • 19

1 Answers1

2

Since v2.0 you can't get access to all friends anymore, that's just how it is. You can read more about that in this thread, the accepted answer is from a Facebook employee: 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
  • yes..your correct...now i have to change version to get friends list? – Jayashree Dec 02 '15 at 10:20
  • 1
    you can't downgrade the api version. it is just not possible anymore to get access to all friends. everything you need to know is in my answer, please read the accepted answer in the link i added. – andyrandy Dec 02 '15 at 10:22