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 32d74c4fc7454a7d5c160961256d3d167ec180c2..62c79abe5c98e31386d8232d0e704b94b1a89fde 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -156,7 +156,7 @@ public class FIRLocalMessagingHelper { //vibrate if(bundle.containsKey("vibrate")){ - long vibrate = bundle.getLong("vibrate", Math.round(bundle.getDouble("vibrate", bundle.getInt("vibrate")))); + long vibrate = Math.round(bundle.getDouble("vibrate", DEFAULT_VIBRATION)); if(vibrate > 0){ notification.setVibrate(new long[]{0, vibrate}); }else{ diff --git a/index.js b/index.js index 38cca3e7f7268ade6532d85d6358063c5b6ed4d4..10361c13647019aad95ff8d93b49e59af2bcaa94 100644 --- a/index.js +++ b/index.js @@ -49,6 +49,9 @@ FCM.scheduleLocalNotification = function(details) { if (!details.id) { throw new Error("id is required for scheduled notification"); } + if (!details.fire_date) { + throw new Error("fire_date is required for scheduled notification"); + } details.local_notification = true; RNFIRMessaging.scheduleLocalNotification(details); }; diff --git a/package.json b/package.json index 89326d5415e243e283fe5d068496f3adcdfa98ad..8fb560208a3b8e2c702698aa8ebc8b0a96be7ddd 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,5 @@ "type": "git", "url": "git+https://github.com/evollu/react-native-fcm.git" }, - "version": "6.2.1" + "version": "6.2.2" }