I have a Mac Catalyst app that requires custom sounds for notifications. These sounds are configurable by users server-side from a pre-defined list, so I already have all the files and have them bundled in the app's resources. The filename is sent as the data corresponding to the "sound" key of the apns payload as specified in the apple dev docs.
The sound files are:
- in caf format
- imported with the "copy if needed" tickbox checked
- correctly show up in the "copy bundle resources" step in the Build Phases tab in XCode
- are marked as available to macOS.
- are present in the app's Contents folder when built
Plus they work correctly in the iOS version of the app. But when a remote notification is received by the Catalyst app it plays the default system sound. This is regardless of dev or production mode apns sandboxes, and all that.
A way I can workaround this is to put the sound files in the Library/Sounds folder (either at the User level or the Hard Drive level) and restart the computer, then those files will be found. This is obviously not ideal, does anyone know how to get these to actually work, or has gotten this to work and can share their build setup?