diff --git a/README.md b/README.md index 6963ffaad..ab671d93b 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ In your `android/app/src/main/AndroidManifest.xml` - + @@ -322,7 +322,7 @@ PushNotification.localNotification({ ongoing: false, // (optional) set whether this is an "ongoing" notification priority: "high", // (optional) set notification priority, default: high visibility: "private", // (optional) set notification visibility, default: private - ignoreInForeground: false, // (optional) if true, the notification will not be visible when the app is in the foreground (useful for parity with how iOS notifications appear) + ignoreInForeground: false, // (optional) if true, the notification will not be visible when the app is in the foreground (useful for parity with how iOS notifications appear). should be used in combine with `com.dieam.reactnativepushnotification.notification_foreground` setting shortcutId: "shortcut-id", // (optional) If this notification is duplicative of a Launcher shortcut, sets the id of the shortcut, in case the Launcher wants to hide the shortcut, default undefined onlyAlertOnce: false, // (optional) alert will open only once with sound and notify, default: false diff --git a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java index 4af0411f1..a4e0af3bb 100644 --- a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java +++ b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java @@ -319,9 +319,12 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB String smallIcon = bundle.getString("smallIcon"); if (smallIcon != null && !smallIcon.isEmpty()) { - smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName); + smallIconResId = res.getIdentifier(smallIcon, "drawable", packageName); + if (smallIconResId == 0) { + smallIconResId = res.getIdentifier(smallIcon, "mipmap", packageName); + } } else if(smallIcon == null) { - smallIconResId = res.getIdentifier("ic_notification", "mipmap", packageName); + smallIconResId = res.getIdentifier("ic_notification", "mipmap", packageName); } if (smallIconResId == 0) { @@ -341,9 +344,12 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB String largeIcon = bundle.getString("largeIcon"); if (largeIcon != null && !largeIcon.isEmpty()) { - largeIconResId = res.getIdentifier(largeIcon, "mipmap", packageName); + largeIconResId = res.getIdentifier(largeIcon, "drawable", packageName); + if (largeIconResId == 0) { + largeIconResId = res.getIdentifier(largeIcon, "mipmap", packageName); + } } else if(largeIcon == null) { - largeIconResId = res.getIdentifier("ic_launcher", "mipmap", packageName); + largeIconResId = res.getIdentifier("ic_launcher", "mipmap", packageName); } // Before Lolipop there was no large icon for notifications.