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";
To change your Samsung phone's notification sound, go to "Sounds and vibration" in the Settings app. You can import audio by downloading sounds to your phone and using the My Files app to copy them to the Notifications folder.
You can convert from wav and mp3 using:
afconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With