From 298d20436acf08ffa30c1b27cdbb4fad1fbb8fdb Mon Sep 17 00:00:00 2001 From: Dmitriy Grachev Date: Thu, 5 Nov 2020 13:07:17 +0300 Subject: [PATCH] fixed duplicate sending of notifications in the foreground --- .../modules/RNReceivedMessageHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNReceivedMessageHandler.java b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNReceivedMessageHandler.java index 1c9247165..c9769b23c 100644 --- a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNReceivedMessageHandler.java +++ b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNReceivedMessageHandler.java @@ -172,7 +172,7 @@ private void handleRemotePushNotification(ReactApplicationContext context, Bundl jsDelivery.notifyRemoteFetch(bundle); } - if (config.getNotificationForeground() || !isForeground) { + if (config.getNotificationForeground() && !isForeground) { Log.v(LOG_TAG, "sendNotification: " + bundle); pushNotificationHelper.sendToNotificationCentre(bundle);