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.
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
}
-
—
bearc0025
Add a CommentI'm running into the same thing but I don't want to show the alert.
I found this but .list isn't doing the trick for me: https://stackoverflow.com/questions/69023854/ios-15-notification-sounds-are-not-playing-for-foreground-notifications