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());
}
});