From 89c6636434d24d5a49c713f0ad694a1ff5d1219c Mon Sep 17 00:00:00 2001 From: Gilad Novik Date: Sun, 22 Apr 2018 14:44:32 +0300 Subject: [PATCH] Allow passing null as a sound As per this answer: https://stackoverflow.com/a/46634508/306764 --- .../firebase/notifications/RNFirebaseNotificationManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 46417c96..214c9967 100644 --- a/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java +++ b/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java @@ -560,7 +560,9 @@ public class RNFirebaseNotificationManager { } private Uri getSound(String sound) { - if (sound.contains("://")) { + if (sound == null) + return null; + else if (sound.contains("://")) { return Uri.parse(sound); } else if (sound.equalsIgnoreCase("default")) { return RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);