iOS 15.1 - Notification sound is not playing with only .sound option set

Viewed 696

We have an issue when we tried to fire only the sound in the push notification in iOS 15.

Sound does not play when UNNotificationPresentationOptions is only set as sound. [.sound] (see snippet code attached)

It seems iOS 15 silence this. It was working before in iOS 14 but stopped working for iOS 15.

The following StackOverflow's URLs recommend playing a sound with AudioServicesPlaySystemSound.

iOS 15 - Notification sounds are not playing for foreground notifications

Before iOS 15, I was able to send sound only local notification, Now I have to show banner

Any tips/recommendations on how to resolve this? Does anyone know if Apple does not allow this anymore?

func taskNotificationCenter(_ center: TaskNotificationCenterType,
               willPresent notification: UNNotificationType,
               withCompletionHandler completionHandler:
                @escaping (UNNotificationPresentationOptions) -> Void) {  
  completionHandler([.sound]) // does not work
//completionHandler([.sound, .alert, .badge]) // works
}

******* LAST UPDATE 26/07/22:** This looks to be fixed on iOS 16.

0 Answers
Related