diff --git a/ios/RNFirebase/notifications/RNFirebaseNotifications.m b/ios/RNFirebase/notifications/RNFirebaseNotifications.m index e84bfb97..ebae5bff 100644 --- a/ios/RNFirebase/notifications/RNFirebaseNotifications.m +++ b/ios/RNFirebase/notifications/RNFirebaseNotifications.m @@ -465,7 +465,11 @@ RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro content.userInfo = notification[@"data"]; } if (notification[@"sound"]) { - content.sound = notification[@"sound"]; + if ([@"default" isEqualToString:notification[@"sound"]]) { + content.sound = [UNNotificationSound defaultSound]; + } else { + content.sound = [UNNotificationSound soundNamed:notification[@"sound"]]; + } } if (notification[@"subtitle"]) { content.subtitle = notification[@"subtitle"]; diff --git a/tests/src/firebase.js b/tests/src/firebase.js index 31ee4787..1ff5bffd 100644 --- a/tests/src/firebase.js +++ b/tests/src/firebase.js @@ -73,6 +73,7 @@ const notifications = async () => { .setTitle('Test title') .setBody('Test body') .setNotificationId('displayed') + .setSound('default') .android.addAction(action) .android.setChannelId('test') .android.setClickAction('action') @@ -100,7 +101,7 @@ const notifications = async () => { } }; -// notifications(); +notifications(); // Invitations testing const invitations = async () => {