我正在编写使用 facebook api 的 android 应用程序,我需要我的应用程序可以检索用户个人资料图片。
这是我当前的权限:
fb_login_button.setReadPermissions(Arrays.asList("public_profile", "user_friends"));
但我在文档中没有看到任何获取用户个人资料图片的权限,只有访问所有图片的权限(我对此不感兴趣)。 因此,现在无需任何许可即可访问个人资料图片
最佳答案
public_profile 权限也可以为您提供个人资料照片。
这就是您将获得个人资料照片的方式
public static Bitmap getFacebookProfilePicture(String userID){
URL imageURL = new URL("https://graph.facebook.com/" + userID + "/picture?type=large");
Bitmap bitmap = BitmapFactory.decodeStream(imageUrl.openConnection().getInputStream());
return bitmap;
}
Bitmap bitmap = getFacebookProfilePicture(userId);
关于android - Facebook android 应用权限 : ask for get user profile picture,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24929182/