【发布时间】:2017-10-09 10:08:55
【问题描述】:
我正在创建一个带有 UNNotificationSound 的 UNNotificationRequest:
content.sound = UNNotificationSound(named: "alarmSounds/alarmAscending.caf")
声音在主项目文件夹中的文件夹(蓝色)alarmSounds中。
使用的声音始终是默认声音,而不是我的声音。我也尝试过在“named:”参数中没有“alarmSound/”但仍然无法正常工作。
我需要对声音文件做些什么特别的事情吗?
这是使用 xcode 9 并在 iOS 11 设备上试用。
【问题讨论】:
-
确保声音文件放在项目包中。
标签: ios swift xcode unnotificationrequest