6

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?

iTarek
  • 736
  • 1
  • 8
  • 17

1 Answers1

-1

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.

  • This just agrees with the question, saying you're seeing the same phenomenon. But "Me too" is not an answer. – matt Oct 12 '21 at 18:12
  • The response clearly includes the suggestion of using AudioServicesPlaySystemSound instead – user3353784 Oct 13 '21 at 19:08
  • If your app is not running or is backgrounded, how does that produce sound at the required time? – matt Oct 13 '21 at 19:11
  • As mentioned, for our use case this is an acceptable trade off, until some other resolution is available via Apple. The goal of the answer being to offer a possible work around to a frustrating change in iOS – user3353784 Oct 15 '21 at 15:21
  • Well we don't know what your use case is. The question is about the OP's use case, and this doesn't meet it. The question is "send local notification with sound only on iOS 15". I see no evidence that you're doing that or that you're sending a local notification at all. – matt Oct 15 '21 at 15:24