Commit a164f490 authored by Libin Lu's avatar Libin Lu

fix vibration

parent f6157b0b
...@@ -156,7 +156,7 @@ public class FIRLocalMessagingHelper { ...@@ -156,7 +156,7 @@ public class FIRLocalMessagingHelper {
//vibrate //vibrate
if(bundle.containsKey("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){ if(vibrate > 0){
notification.setVibrate(new long[]{0, vibrate}); notification.setVibrate(new long[]{0, vibrate});
}else{ }else{
......
...@@ -49,6 +49,9 @@ FCM.scheduleLocalNotification = function(details) { ...@@ -49,6 +49,9 @@ FCM.scheduleLocalNotification = function(details) {
if (!details.id) { if (!details.id) {
throw new Error("id is required for scheduled notification"); 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; details.local_notification = true;
RNFIRMessaging.scheduleLocalNotification(details); RNFIRMessaging.scheduleLocalNotification(details);
}; };
......
...@@ -24,5 +24,5 @@ ...@@ -24,5 +24,5 @@
"type": "git", "type": "git",
"url": "git+https://github.com/evollu/react-native-fcm.git" "url": "git+https://github.com/evollu/react-native-fcm.git"
}, },
"version": "6.2.1" "version": "6.2.2"
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment