[notifications][android] Support file:// urls for bitmaps

This commit is contained in:
Chris Bianca 2018-04-10 16:14:06 +01:00
parent eb91523478
commit 5dbb6bc9fd
1 changed files with 2 additions and 0 deletions

View File

@ -516,6 +516,8 @@ public class RNFirebaseNotificationManager {
private Bitmap getBitmap(String image) {
if (image.startsWith("http://") || image.startsWith("https://")) {
return getBitmapFromUrl(image);
} else if (image.startsWith("file://")) {
return BitmapFactory.decodeFile(image);
} else {
int largeIconResId = getResourceId("mipmap", image);
return BitmapFactory.decodeResource(context.getResources(), largeIconResId);