Non-Main Bundle File as Alert Sound

Set local notification sound from Main bundle

Maybe you don‘t add the sound file (*.caf) in Xcode project: Build Phases/Copy Bundle Resources.

How do I add a file to the main bundle's /Library/Sounds directory?

the link you have is for Mac! the correct document for iOS should be here

in summary, you can just add the sound file to your project as a nonlocalized resource of the app bundle.

Custom sound for Local Notifications not working

Go to target > Build Phases > Copy Bundle Resource > Click + . add Sound.caf to copy Bundle Resource . hopefully it will works.

Sample Image

Swift add audio files to bundle when released

Short answer : This is not possible.

Due to the code signing concept – the whole bundle is signed to be protected against mutation – you can't add files at runtime to the main bundle of the application.

Custom sounds for local notification in iphone is not working

Remember that your notification sounds may not be longer than 30 seconds - if the file supplied is longer, nothing will sound.

Also, check the sound in some external player first, and best convert it to .caf format.

To convert a file to .caf, open up terminal, go to where you have your sound stored and type in:

afconvert -f caff -d LEI16@44100 -c 1 yourfile.wav yourfile.caf

Then just set it like:

yourNotification.soundName = @"yoursound_name.caf";


Related Topics



Leave a reply



Submit