我正在尝试为本地通知提供自定义通知声音。但它仍然以默认声音播放
let content = UNMutableNotificationContent()
content.title = NSString.localizedUserNotificationString(forKey:
"Test", arguments: nil)
content.body = NSString.localizedUserNotificationString(forKey:
"Test message", arguments: nil)
content.sound = UNNotificationSound.init(named: "marbles-daniel_simon.mp3")
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60,
repeats: true)
let request = UNNotificationRequest(identifier: "test", content: content, trigger: trigger)
center.add(request, withCompletionHandler: nil)
我在项目中添加了声音文件,如下所示