Jack Humphries Jack Humphries - 1 year ago 108
iOS Question

Choose custom sound for local notifications

How do you change the sound that plays for local notifications? I use the code below to play the default sound:

notif.soundName = UILocalNotificationDefaultSoundName;

So, I tried this below, and it didn't work. What should I do? Thanks for your help!

notif.soundName = @"sound.caf";

Answer Source

That should work. Make sure the sound is actually in your app’s bundle, is in the correct format (linear PCM or IMA4—pretty much anywhere that explains how to convert sounds for iOS will tell you how to do that), and is under 30 seconds.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download