From 50245096bed723af2fef71732daa15240c5394fe Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 20 Jul 2017 11:24:31 -0400 Subject: [PATCH] don't send notif only for scheduled local notif --- .../com/evollu/react/fcm/FIRLocalMessagingHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 38b9fec..eca899a 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -186,10 +186,12 @@ public class FIRLocalMessagingHelper { notification.setDefaults(NotificationCompat.DEFAULT_LIGHTS); } - 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(bundle.containsKey("fire_date")) { + Log.d(TAG, "broadcast intent if it is a scheduled 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(); -- 2.26.2