notification sounds for individual apps

The apple support article states:


Choose notification sounds for individual apps


  • You can choose the sound that plays when a notification arrives for an app


but this is not true for most apps, and only has the option to turn sound on or off.


Change notification settings on iPhone - Apple Support


Can we add this basic functionality as a requirement for app iPhone apps that offer notifications? It must be in some type of bootstrap and this just seems like developer laziness. Force check this in w/e build checks you use before allowed to publish please.

Posted on Dec 6, 2024 5:28 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 6, 2024 5:39 PM

I haven’t developed an iOS opp for years now, and it took me 45 seconds to find the basic code, just do w/e to allow the user to select the customNotificationSound



let content = UNMutableNotificationContent()

content.title = "New Message"

content.body = "You have a new message!"

content.sound = UNNotificationSound(named: "customNotificationSound") // "customNotificationSound.wav" should be in your app bundle



let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)

let request = UNNotificationRequest(identifier: "myNotification", content: content, trigger: trigger)



UNUserNotificationCenter.current().add(request) { (error) in

    // Handle any errors


3 replies
Question marked as Top-ranking reply

Dec 6, 2024 5:39 PM in response to Johnny764

I haven’t developed an iOS opp for years now, and it took me 45 seconds to find the basic code, just do w/e to allow the user to select the customNotificationSound



let content = UNMutableNotificationContent()

content.title = "New Message"

content.body = "You have a new message!"

content.sound = UNNotificationSound(named: "customNotificationSound") // "customNotificationSound.wav" should be in your app bundle



let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)

let request = UNNotificationRequest(identifier: "myNotification", content: content, trigger: trigger)



UNUserNotificationCenter.current().add(request) { (error) in

    // Handle any errors


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

notification sounds for individual apps

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.