From aa67cfef344443f0f920b26b0057f81b3f2f11c4 Mon Sep 17 00:00:00 2001 From: Douglas Nassif Roma Junior Date: Mon, 21 Aug 2017 13:37:17 -0300 Subject: [PATCH] Allow local notification without sound for iOS. --- ios/RNFIRMessaging.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ios/RNFIRMessaging.m b/ios/RNFIRMessaging.m index 3c070b2..3e60d7d 100644 --- a/ios/RNFIRMessaging.m +++ b/ios/RNFIRMessaging.m @@ -45,9 +45,11 @@ RCT_ENUM_CONVERTER(NSCalendarUnit, content.body =[RCTConvert NSString:details[@"body"]]; NSString* sound = [RCTConvert NSString:details[@"sound"]]; if(sound != nil){ - content.sound = [UNNotificationSound soundNamed:sound]; - }else{ - content.sound = [UNNotificationSound defaultSound]; + if ([sound isEqual:@"default"]) { + content.sound = [UNNotificationSound defaultSound]; + } else { + content.sound = [UNNotificationSound soundNamed:sound]; + } } content.categoryIdentifier = [RCTConvert NSString:details[@"click_action"]]; content.userInfo = details; -- 2.26.2