From 39e014a4746a938daf0de4f7cbc4c46565c6c0db Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Wed, 12 Oct 2016 10:54:54 -0400 Subject: [PATCH] always broadcast notification before showing --- android/react-native-fcm.iml | 2 -- .../com/evollu/react/fcm/FIRLocalMessagingHelper.java | 10 ++++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/android/react-native-fcm.iml b/android/react-native-fcm.iml index 02e9551..c3148c6 100644 --- a/android/react-native-fcm.iml +++ b/android/react-native-fcm.iml @@ -82,7 +82,6 @@ - @@ -94,7 +93,6 @@ - diff --git a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java index ec47475..8361185 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -155,12 +155,10 @@ public class FIRLocalMessagingHelper { notification.setDefaults(NotificationCompat.DEFAULT_LIGHTS); } - if(mIsForeground){ - Log.d(TAG, "App is in foreground, broadcast intent instead"); - Intent i = new Intent("com.evollu.react.fcm.ReceiveLocalNotification"); - i.putExtras(bundle); - mContext.sendOrderedBroadcast(i, null); - } + Log.d(TAG, "broadcast intent before showing notification"); + Intent i = new Intent("com.evollu.react.fcm.ReceiveLocalNotification"); + i.putExtras(bundle); + mContext.sendOrderedBroadcast(i, null); if(!mIsForeground || bundle.getBoolean("show_in_foreground")){ Intent intent = new Intent(mContext, intentClass); -- 2.26.2