Skip to content

Commit 85d593f

Browse files
author
Mike McCartney
committed
PR zo0r#954: Merge remote-tracking branch 'zhangjunhou/master'
2 parents c329124 + 0ad7b12 commit 85d593f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationListenerService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ private void handleRemotePushNotification(ReactApplicationContext context, Bundl
130130
}
131131

132132
Log.v(LOG_TAG, "sendNotification: " + bundle);
133-
134-
Application applicationContext = (Application) context.getApplicationContext();
135-
RNPushNotificationHelper pushNotificationHelper = new RNPushNotificationHelper(applicationContext);
136-
pushNotificationHelper.sendToNotificationCentre(bundle);
133+
if (!isForeground) {
134+
Application applicationContext = (Application) context.getApplicationContext();
135+
RNPushNotificationHelper pushNotificationHelper = new RNPushNotificationHelper(applicationContext);
136+
pushNotificationHelper.sendToNotificationCentre(bundle);
137+
}
137138
}
138139

139140
private boolean isApplicationInForeground() {

0 commit comments

Comments
 (0)