I use Facebook 4.7 SDK and Graph Ver.2.5 I do not get Detail of a users friends
GraphRequest request = GraphRequest.newMeRequest(AccessToken.getCurrentAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject jsonObject, GraphResponse graphResponse) {
if (jsonObject != null) {
try {
JSONObject friends = jsonObject.getJSONObject("friends");
JSONArray array = friends.getJSONArray("data");
for (int i = 0; i < array.length(); i++) {
JSONObject object = array.getJSONObject(i);
Toast.makeText(getApplication(),"...Name:" + object.getString("name"),Toast.LENGTH_SHORT).show();
Log.d("MyApp", "...ID:" + object.getString("id"));
Log.d("MyApp", "...Name:" + object.getString("name"));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
});
can someone give a full example of the facebook graph API friend list?
user_friends
permission too – right? – CBroe