Update RNFirebaseNotificationManager.java
Retrieve vibration array as IntegerArray and check for null in case of improper usage.
This commit is contained in:
parent
4874bd32d0
commit
b02258b444
|
@ -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<Integer> 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");
|
||||
|
|
Loading…
Reference in New Issue