androidfacebookfacebook-graph-apifacebook-friends

RETRIEVING FACEBOOK FRIEND LIST- in compliance with the recent sdk changes


I'm interested in getting the user's friend list in my android application on facebook login. Can anyone please guide me as to what needs to be done? Since Facebook made new changes in he Graph API on the 10th of July. I'm a little hesitant in trying out the solutions provided earlier. A detailed guide is what I need.


Solution

  • try this to get friend list from facebook.

    GraphRequest.newMyFriendsRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONArrayCallback() {
                    @Override
                    public void onCompleted(JSONArray jsonArray, GraphResponse graphResponse) {
    
                            Utils.setLog("response :+" + jsonArray.toString());
    
                        } catch (Exception e) {
                            //Exception Track
                            e.printStackTrace();
                        }
    
                    }
                }).executeAsync();
    

    before make sure you have to ask permission for user_friends from facebook.