Trying to figure out the Graphi api Facebook queries. Found a request (in one of the topics):

AccessToken token = AccessToken.getCurrentAccessToken(); String userId = token.getUserId(); String path = "/friends"; new GraphRequest( token, userId + path, null, HttpMethod.GET, new GraphRequest.Callback() { public void onCompleted(GraphResponse response) { // handle the result System.out.println("Response error: " + response.getError()); System.out.println("Raw: " + response.getRawResponse()); } } ).executeAsync(); 

The request returns:

 {"data":[], "summary":{ "total_count":49} } 

That is, the number of friends of the user. How can I modify the request so that it would display even the name and surname of a friend? Thank !!

  • Do you yourself format the code of the eye does not cut? Convenient, comfortable to read, if you were asked to help with this code - would you spend time answering or bringing the code to a human mind? - AK
  • And really, I'm sorry ... - Donald Rump

1 answer 1

This answer means that the token does not have permission to receive information about friends. Add user_friends to permissions for a token. You can check the performance of your queries using Graph API Explorer

  • But how to do it ? - Donald Rump
  • what is it? create a token? or use Graph API Explorer? create a new question. since you have received the current answer. - Mikhail Vaysman
  • Well, not quite. The answer to the fact is that the request / friends returns information about the friends who installed my application, and since there are no such users, it returns nothing. The number of friends at the same time, returns by default. - Donald Rump
  • one
    There is nothing in your question about the application, etc. There is a question why an empty list is returned. I gave you the answer. - Mikhail Vaysman
  • I agree. Thanks for the answer ! - Donald Rump