From b02258b4448073ea67c7a3ebe11d24d9b48c98dd Mon Sep 17 00:00:00 2001 From: Tal Davidi Date: Mon, 26 Mar 2018 12:06:22 -0400 Subject: [PATCH] Update RNFirebaseNotificationManager.java Retrieve vibration array as IntegerArray and check for null in case of improper usage. --- .../notifications/RNFirebaseNotificationManager.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java index 3d8c3923..534a73c3 100644 --- a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java +++ b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java @@ -352,12 +352,14 @@ public class RNFirebaseNotificationManager { nb = nb.setUsesChronometer(android.getBoolean("usesChronometer")); } if (android.containsKey("vibrate")) { - double[] vibrate = android.getDoubleArray("vibrate"); - long[] vibrateArray = new long[vibrate.length]; - for (int i = 0; i < vibrate.length; i++) { - vibrateArray[i] = ((Double)vibrate[i]).longValue(); + ArrayList vibrate = android.getIntegerArrayList("vibrate"); + if(vibrate != null) { + long[] vibrateArray = new long[vibrate.size()]; + for (int i = 0; i < vibrate.size(); i++) { + vibrateArray[i] = (vibrate.get(i).longValue(); + } + nb = nb.setVibrate(vibrateArray); } - nb = nb.setVibrate(vibrateArray); } if (android.containsKey("visibility")) { Double visibility = android.getDouble("visibility");