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.
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
Exception: Cannot Manually Set the Delegate on a Uinavigationbar Managed by a Controller
How to Properly Handle a Nil Uiapplication.Sharedapplication().Keywindow
Replace C Style For-Loop in Swift 2.2.1
Swift Parse - Local Datastore and Displaying Objects in a Tableview
Writing JSON File Programmatically Swift
Video Thumbnail Taking 10-15 Secs to Display
How to Parse a Iso 8601 Duration Format in Swift
Realmswift Cannot Cast Results<Someojbect> to Results<Object>
Why Is This Array Out of Index
Horizontal Paging Uicollectionview with Automatic Item Size in a Vertical Stack View
iOS Revoke Location Services Permission Programmatically
Scene Kit Memory Management Using Swift
Aes 128 Message Decryption -- Swift, iOS
How to Remove Single Object in Array from Multiple Matching Object
How to Get Account Name from Contact Framework
Module Compiled with Swift 5.1.2 Cannot Be Imported by the Swift 5.2.4 Compiler