My app uses UNMutableNotificationContent() to play a custom sound, and has a phrase as a message. I just got a vehicle with CarPlay. When my iPhone is connected to CarPlay, when the notification goes off at the time I have it set, it shows on the iPhone, but does not make any noise whatsoever.
What I'd like to happen, is for CarPlay to receive the notification and play the sound, or announce the message when the notification goes off, like it does with Apple's messages app. As my phone is set right now, when I have my airPods in, it will announce the notification from my app. But not for CarPlay.
What do I need to add to my app to allow CarPlay to handle the message that comes in from a notification (again, local, not a push notification).
After reading a bunch of posts on here and Apple Developer, I added this to my teat app on this.
let category = UNNotificationCategory(identifier: "CarPlay", actions: [], intentIdentifiers: [], options: [.allowInCarPlay])
UNUserNotificationCenter.current().setNotificationCategories([category])
and
content.categoryIdentifier = "CarPlay"
to the notification. It still doesn't do anything different. Nothing on CarPlay at all.