From 15299429fe6e98d47c1ce355926510f2173e25a5 Mon Sep 17 00:00:00 2001 From: Gilad Novik Date: Mon, 16 Apr 2018 19:38:32 +0300 Subject: [PATCH] allow using ringtones from RingtoneManager when allowing users to pick a sound from RingtoneManager, RNFirebaseNotification should detect we are passing a Uri instead of trying to load this file from our bundle. --- .../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 25eadab3..46417c96 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.equalsIgnoreCase("default")) { + if (sound.contains("://")) { + return Uri.parse(sound); + } else if (sound.equalsIgnoreCase("default")) { return RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); } else { int soundResourceId = getResourceId("raw", sound);