Fix long notification with images conflict 2
This commit is contained in:
parent
d94cdf0d1b
commit
2126bc4f02
@ -106,12 +106,13 @@ public class MessagingService extends FirebaseMessagingService {
|
|||||||
.setAutoCancel(autoCancel)
|
.setAutoCancel(autoCancel)
|
||||||
.setSound(defaultSoundUri)
|
.setSound(defaultSoundUri)
|
||||||
.setContentIntent(pendingIntent);
|
.setContentIntent(pendingIntent);
|
||||||
|
Bitmap image;
|
||||||
if (URLUtil.isValidUrl(imageUrl)) {
|
if (URLUtil.isValidUrl(imageUrl)) {
|
||||||
Bitmap image = getBitmapFromURL(imageUrl);
|
image = getBitmapFromURL(imageUrl);
|
||||||
|
}
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
notificationBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(image).bigLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.blank_icon)));
|
notificationBuilder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(image).bigLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.blank_icon)));
|
||||||
notificationBuilder.setLargeIcon(image);
|
notificationBuilder.setLargeIcon(image);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle()
|
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle()
|
||||||
.bigText(messageBody));
|
.bigText(messageBody));
|
||||||
|
Reference in New Issue
Block a user