From 838461431b74ef51cb0567a8c00e2ab3aca3677a Mon Sep 17 00:00:00 2001 From: Janne Saarela Date: Tue, 11 Sep 2018 15:24:52 +0300 Subject: [PATCH] Fix Android rescheduled notifications firing immediately, ref: https://github.com/invertase/react-native-firebase/pull/1035/files --- .../com/evollu/react/fcm/FIRLocalMessagingHelper.java | 8 ++++---- 1 file changed, 4 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 a711733..85f709b 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -58,11 +58,11 @@ public class FIRLocalMessagingHelper { return; } - long fireDate = Math.round(bundle.getDouble("fire_date")); - if(fireDate == 0){ - fireDate = Math.round(bundle.getLong("fire_date")); + Long fireDate = bundle.getLong("fire_date", -1); + if (fireDate == -1) { + fireDate = (long) bundle.getDouble("fire_date", -1); } - if (fireDate == 0) { + if (fireDate == -1) { Log.e(TAG, "failed to schedule notification because fire date is missing"); return; } -- 2.26.2