Get the soundName by soundID to assign it to a UILocalNotification

后端 未结 1 1300
陌清茗
陌清茗 2021-01-27 08:44

I have a UILocalNotification, and I don\'t want to set it to use a default tone. I have used AudioToolbox.framework, and I have a SystemSoundID by refe

相关标签:
1条回答
  • 2021-01-27 09:04

    Description of soundName in UILocalNotification Class Reference mentions

    For this property, specify the filename (including extension) of a sound resource in the app’s main bundle or UILocalNotificationDefaultSoundName to request the default system sound.

    So if you want the default local notification sound use UILocalNotificationDefaultSoundName.

    Also, a note from Multimedia Programming Guide

    Note: System-supplied alert sounds and system-supplied user-interface sound effects are not available to your application.

    So you cannot use any system sound id you find in iOSSystemSoundsLibrary for this.

    If you want a custom sound, you'll have to provide your own.

    0 讨论(0)
提交回复
热议问题