I\'ve following problem with Facebook SDK 3.0 for Android. I wanna get my (and my friends) profile picture without using their ProfilePictureView widget, so if I use Graph Explo
You can get the profile picture by requesting to the Graph API. You need to pass the accessToken ,the user ID and also set the redirect false. Then the Graph API returns the JSON and from the JSON you can get url field which is the user profile.
GraphRequest request = new GraphRequest(accessToken, "/" + userID + "/picture",null,HttpMethod.GET, new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
Log.d("Photo Profile", response.getJSONObject().toString());
JSONObject jsonObject = response.getJSONObject();
try {
JSONObject data = jsonObject.getJSONObject("data");
String url = data.getString("url");
Picasso.with(getApplicationContext()).load(url).into(ivProfilePicture);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Bundle parameters =new Bundle();
parameters.putString("type","large");
parameters.putBoolean("redirect",false);
request.setParameters(parameters);
request.executeAsync();