0

I'm tring to show facebook friend list into my android app

About 2 months i am tring to get my friends (who clicked Continue with facebook button) but every time the Graph give me an empty array with actual number of friends .. can anyone help me ?

that's result of my code :

{Response:  responseCode: 200, graphObject: {"data":[],"summary":{"total_count":104}}, error: null}

Login code

FacebookSdk.sdkInitialize(this.getApplicationContext());
        callbackManager = CallbackManager.Factory.create();


        loginButton = (LoginButton) findViewById(R.id.login_button);
        loginButton.setTextColor(Color.WHITE);
        loginButton.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
        loginButton.setCompoundDrawablePadding(0);
        loginButton.setReadPermissions("user_friends");

Getting Friends :

// Callback registration
        loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {

                GraphRequest request = GraphRequest.newGraphPathRequest(
                        loginResult.getAccessToken(),
                        "/"+loginResult.getAccessToken().getUserId()+"/friends",
                        new GraphRequest.Callback() {
                            @Override
                            public void onCompleted(GraphResponse response) {
                                // Insert your code here

                                Log.d("neo9",response.toString());
                            }
                        });

                request.executeAsync();


            }

            @Override
            public void onCancel() {
                // App code
                Log.d("neo7","cancel");
            }

            @Override
            public void onError(FacebookException exception) {
                // App code
                Log.d("neo7",exception.getMessage());
            }
        });
  • Possible duplicate of [Android Facebook SDK How to get all friends list who installed my app](https://stackoverflow.com/questions/38610412/android-facebook-sdk-how-to-get-all-friends-list-who-installed-my-app) – MurugananthamS Apr 08 '19 at 04:08
  • Possible duplicate of [Facebook Graph API v2.0+ - /me/friends returns empty, or only friends who also use my application](https://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u) – andyrandy Apr 08 '19 at 06:26

0 Answers0