【发布时间】:2018-03-29 17:05:07
【问题描述】:
我想知道是否可以在用户通知上使用 Apple 的通知声音之一,而不是始终使用 UNNotificationSound.default() 来发出声音,或者让用户能够进入设置并选择一种声音。
【问题讨论】:
标签: swift notifications system-sounds unusernotification
我想知道是否可以在用户通知上使用 Apple 的通知声音之一,而不是始终使用 UNNotificationSound.default() 来发出声音,或者让用户能够进入设置并选择一种声音。
【问题讨论】:
标签: swift notifications system-sounds unusernotification
不,您不能使用任何系统声音。可用的系统声音位于Library/Audio,但您只能使用来自Library/Sounds 的声音。
但是,您仍然可以通过提供声音文件和使用init(named:) 进行初始化来提供用户可以选择的自定义声音。
【讨论】: