I want to get Facebook friend list with gender in my Android project. My Code;
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/"+ AccessToken.getCurrentAccessToken().getUserId()+"/taggable_friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
try {
JSONObject jsonObjectData = response.getJSONObject();
JSONArray jsonArrayData = jsonObjectData.getJSONArray("data");
personList = new ArrayList<Person>();
for (int i = 0; i < jsonArrayData.length(); i++) {
JSONObject jsonObjectPerson = jsonArrayData.getJSONObject(i);
Person person = new Person();
person.setId(jsonObjectPerson.optString("id"));
person.setName(jsonObjectPerson.optString("name"));
personList.add(person);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
).executeAsync();
This method return to me 3 parameters; ID
, NAME
and PICTURE
. I try to change endPoint
with "/friends"
but this time data was null. When I try to use FQL
, I get this message:
"fql is deprecated for versions v2.1 and higher".
How can I get Facebook friend list with gender?