Commit 0c052e92 authored by Libin Lu's avatar Libin Lu Committed by GitHub

fix sound

parent 3ec8893b
...@@ -45,7 +45,12 @@ RCT_ENUM_CONVERTER(NSCalendarUnit, ...@@ -45,7 +45,12 @@ RCT_ENUM_CONVERTER(NSCalendarUnit,
UNMutableNotificationContent *content = [UNMutableNotificationContent new]; UNMutableNotificationContent *content = [UNMutableNotificationContent new];
content.title =[RCTConvert NSString:details[@"title"]]; content.title =[RCTConvert NSString:details[@"title"]];
content.body =[RCTConvert NSString:details[@"body"]]; content.body =[RCTConvert NSString:details[@"body"]];
content.sound = [RCTConvert NSString:details[@"sound"]] ?: [UNNotificationSound defaultSound]; NSString* sound = [RCTConvert NSString:details[@"sound"]];
if(sound != nil){
content.sound = [UNNotificationSound soundNamed:sound];
}else{
content.sound = [UNNotificationSound defaultSound];
}
content.categoryIdentifier = [RCTConvert NSString:details[@"click_action"]]; content.categoryIdentifier = [RCTConvert NSString:details[@"click_action"]];
content.userInfo = details; content.userInfo = details;
content.badge = [RCTConvert NSNumber:details[@"badge"]]; content.badge = [RCTConvert NSNumber:details[@"badge"]];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment