From a164f490c3eb10812bb855d848c124aaf04a8acc Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 13 Apr 2017 13:22:26 -0400 Subject: [PATCH] fix vibration --- .../java/com/evollu/react/fcm/FIRLocalMessagingHelper.java | 2 +- index.js | 3 +++ package.json | 2 +- 3 files changed, 5 insertions(+), 2 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 32d74c4..62c79ab 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 38cca3e..10361c1 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 89326d5..8fb5602 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" } -- 2.26.2