我可能做错了什么。我设法用user.getPhotoUrl获得了Facebook图像,但它只显示了一张低分辨率的图片。
所以我尝试使用此代码。
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
String name = user.getDisplayName();
nameView.setText(user.getDisplayName());
Picasso.with(this).load("https://graph.facebook.com/"+user.getUid()+"/picture?type=large").into(profileImage);
}
我在这里做错了什么?
使用此链接获取所需质量的图片。只需将width=200
替换为所需的宽度,height=200
替换为所需的高度即可。
"https://graph.facebook.com/"+user.getUid()+"/picture?type=large&width=200&height=200"
我设法做到了!
for(UserInfo profile : user.getProviderData()) {
if(profile.getProviderId().equals(getString("facebook.com"))) {
facebookUserId = profile.getUid();
}
}
String photoUrl = "https://graph.facebook.com/" + facebookUserId + "/picture?height=500";
Picasso.with(this).load(photoUrl).into(profileImage);
这对我有用