I am working on an Android application in which any Android user who is logging to Facebook using our Application, I need to extract his photo, his gender, his full name fro
with new API
private void importFbProfilePhoto() {
if (AccessToken.getCurrentAccessToken() != null) {
GraphRequest request = GraphRequest.newMeRequest(
AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject me, GraphResponse response) {
if (AccessToken.getCurrentAccessToken() != null) {
if (me != null) {
String profileImageUrl = ImageRequest.getProfilePictureUri(me.optString("id"), 500, 500).toString();
Log.i(LOG_TAG, profileImageUrl);
}
}
}
});
GraphRequest.executeBatchAsync(request);
}
}