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.
This commit is contained in:
Gilad Novik 2018-04-16 19:38:32 +03:00 committed by GitHub
parent 317b02b901
commit 15299429fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -560,7 +560,9 @@ public class RNFirebaseNotificationManager {
} }
private Uri getSound(String sound) { 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); return RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
} else { } else {
int soundResourceId = getResourceId("raw", sound); int soundResourceId = getResourceId("raw", sound);