diff --git a/CHANGELOG.md b/CHANGELOG.md index b340a20a2..139b16d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo #### Unreleased +#### Version 0.9.13 (07.10.2024) +### 07-10-2024 +- Android: Deliver notifications while app is in foreground if `foreground` option is `true`. [RMET-3699](https://outsystemsrd.atlassian.net/browse/RMET-3699) + #### Version 0.9.12 (27.09.2023) ### 12-09-2023 - Android: Make PendingIntents immutable for Android 14 [RMET-2666](https://outsystemsrd.atlassian.net/browse/RMET-2666) diff --git a/package.json b/package.json index be220a323..e5e3ee8fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-local-notification", - "version": "0.9.12", + "version": "0.9.13", "description": "Schedules and queries for local notifications", "cordova": { "id": "cordova-plugin-local-notification", diff --git a/plugin.xml b/plugin.xml index 899ea49c0..1e2bb8fb5 100644 --- a/plugin.xml +++ b/plugin.xml @@ -24,7 +24,7 @@ + version="0.9.13"> LocalNotification diff --git a/src/android/notification/Notification.java b/src/android/notification/Notification.java index 954e019af..06c9a1768 100644 --- a/src/android/notification/Notification.java +++ b/src/android/notification/Notification.java @@ -385,8 +385,11 @@ private void cancelScheduledAlarms() { * Present the local notification to user. */ public void show() { - // Don't show notification if the application is in foreground - if(applicationState == null || applicationState.equalsIgnoreCase("foreground")) return; + // Don't show notification if the application is in foreground and foreground option is false + boolean showEvenInForeground = getOptions().getDict().optBoolean("foreground", false); + + if (applicationState == null || (applicationState.equalsIgnoreCase("foreground") && !showEvenInForeground)) + return; if (builder == null) return;