R3ptor R3ptor - 1 year ago 188
iOS Question

play system sound for UILocalNotification

I found this project on GitHub: iOS Sounds and Ringtones

Is there a way to play one of those sounds for


So I got the string for

But it still plays the default notification sound.

Answer Source

UILocalNotification accepts only a sound file name, not a file path. And the docs for soundName explain that this file must be "...in the app’s main bundle...". Getting the path to a system sound file is not useful with UILocalNotification because that file is not in your app's main bundle, and because you can't tell UILocalNotification to look somewhere else.