macOS cannot use custom UNNotificationSounds ?

Hello,

The documentation states that one can add a custom sound to User Notifications.

This works on iOS, but doesn't appear to work on macOS.

Am I holding it wrong, or are the docs wrong? https://developer.apple.com/documentation/usernotifications/unnotificationsound

Example minimal project to demo is here: https://github.com/Diggory/macOSLocalNotifications

Thanks.

Answered by Diggory in 731464022

After some great detective work from another developer it seems that the issue is caused by the "Play user interface sound effects" option in the 'Sound Effects' section of the 'Sound' System Preferences pane.

I had to turn that option off, delete my app, reboot, then re-enable that option and the custom sounds now work. The .caf files still don't work, but that can be worked around.

FYI, this is on Monterey 12.6

As this appears to be a bug (to me), I have filed a Radar. (FB11642483)

I've updated the sample app with multiple sounds, in multiple formats. None of them appears to work. Except one MP3 (very odd) - note not any MP3, just this one.

Accepted Answer

After some great detective work from another developer it seems that the issue is caused by the "Play user interface sound effects" option in the 'Sound Effects' section of the 'Sound' System Preferences pane.

I had to turn that option off, delete my app, reboot, then re-enable that option and the custom sounds now work. The .caf files still don't work, but that can be worked around.

macOS cannot use custom UNNotificationSounds ?
 
 
Q