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

745 Views Asked by At

This was working good before iOS 15

let center = UNUserNotificationCenter.current()
let content = UNMutableNotificationContent()
        content.sound = UNNotificationSound.init(named:UNNotificationSoundName(rawValue: sound))
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
center.add(request)

User was getting notification sound, after iOS 15 I have to add

content.body = "Hello iOS 15"

Anyway to send local notification with sound only on iOS 15?

1

There are 1 best solutions below

5
coreyd303 On

Looked deeper on this, we are having the same issue. Best I can tell iOS 15 wont deliver "blank" notifications, not sure if this is a "bug" or intended I couldn't find any documentation around this. We ended up using AudioServicesPlaySystemSound instead for our specific use case. Not sure if that would help you or not.