Recently I worked on a project for a client in which local notifications were needed along with custom ringtones that the user could use. I won’t go into the code about local notifications but more importantly, the ringer files.
First thing you want to do is put them in a “sounds” folder inside the “Resources” directory (reference the sounds files in the code as “sounds/soundname.caf”. Next, you want to convert your sound files to .caf files. An easy way to do this is through Terminal (on a Mac, not sure about PC). Enter the following:
afconvert -f caff -d LEI16@44100 originalfile.mp3 nameofnewfilewhateveryouwant.caf
You’ll need to navigate to the file using Terminal commands but once you get there you’re golden. So now you have your sounds folder, your converted sound files, and the last most important step is to make sure they’re less than appx. 4.5 MB. Any sound file above this seems to not be able to sound off when the notification fires. You end with a silent notification.
As always, I’m sharing for you all but this is just a journal for me to refer to when getting stuck on things I’ve forgotten about. Especially small things like this nuisance.