I cannot get user\'s Facebook profile picture into my imageView. I am trying to get with Picasso library. Have an idea to solve that? Here is my codes. Thanks in advance!
i hope you are asking permission for profile picture from facebook first, bcz without permission facebook will not allow you to get anything.
loginButton.setReadPermissions("public_profile", "email", "user_friends", "user_education_history", "user_hometown", "user_likes", "user_work_history");
or you can also use facebook callback to get user profile image, like this..
private FacebookCallback mCallBack = new FacebookCallback() {
@Override
public void onSuccess(final LoginResult loginResult) {
GraphRequest request = GraphRequest.newMeRequest(
loginResult.getAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object,
GraphResponse response) {
Log.e("response: ", response + "");
try {
String id = object.getString("id").toString();
String email = object.getString("email").toString();
String name = object.getString("name").toString();
String profilePicUrl = "https://graph.facebook.com/" + loginResult.getAccessToken().getUserId() + "/picture?type=large";
Log.d("imageFB", profilePicUrl);
Log.d("FB_ID:", id);
checkFBLogin(id, email, name, profilePicUrl);
} catch (Exception e) {
e.printStackTrace();
}
finish();
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email,gender,birthday,friends,likes,hometown,education,work");
request.setParameters(parameters);
request.executeAsync();
}