From 5f090dabedf33a34e69f613e6f519d86985f2d87 Mon Sep 17 00:00:00 2001 From: Martin Apostolov Date: Thu, 1 Jun 2017 14:44:41 +0300 Subject: [PATCH] Fix setting of 'largeIcon' Set largeIcon before building the notification, otherwise the icon would not be set. --- src/android/com/plugin/gcm/CordovaGCMBroadcastReceiver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/com/plugin/gcm/CordovaGCMBroadcastReceiver.java b/src/android/com/plugin/gcm/CordovaGCMBroadcastReceiver.java index 4dd12f71..df23f292 100644 --- a/src/android/com/plugin/gcm/CordovaGCMBroadcastReceiver.java +++ b/src/android/com/plugin/gcm/CordovaGCMBroadcastReceiver.java @@ -140,13 +140,13 @@ public void createNotification(Context context, Bundle extras) { mBuilder.setDefaults(defaults); } - final Notification notification = mBuilder.build(); final int largeIcon = getLargeIcon(context, extras); if (largeIcon > -1) { final Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), largeIcon); mBuilder.setLargeIcon(bitmap); } - + + final Notification notification = mBuilder.build(); mNotificationManager.notify(appName, notId, notification); }