我有UILocalNotification
,我不想将其设置为使用默认音调。我使用过AudioToolbox.framework,并且我引用了这个库SystemSoundID
:https://github.com/TUNER88/iOSSystemSoundsLibrary。
但是UILocalNotification
需要一个合理的名称。如何从SystemSoundID
获取名称?
答案 0 :(得分:3)
soundName in UILocalNotification Class Reference提及
的说明对于此属性,请指定a的文件名(包括扩展名) 应用程序主要包中的声音资源或 UILocalNotificationDefaultSoundName请求默认系统 声音。
因此,如果您希望默认的本地通知声音使用UILocalNotificationDefaultSoundName
。
此外,来自Multimedia Programming Guide
的说明注意:系统提供的警报声和系统提供的用户界面 您的应用程序无法使用声音效果。
因此,您无法使用iOSSystemSoundsLibrary中找到的任何系统声音ID。
如果您想要自定义声音,则必须提供自己的声音。