APNS Notification Not displayed on CarPlay screen

I am getting badge count when we have the apns notification on carplay but notification not displayed on the carplay screen. I have set mutable-content:1 also...Is there anything else to do get notification on carplay screen. In Iphone enabled carplay notification . Please help me

Replies

Try this:

You have to setup a notification category with .allowInCarPlay option. Then use the category name in the notification's categoryIdentifier field.

    let category = UNNotificationCategory(identifier: "CarPlay", actions: [], intentIdentifiers: [], options: [.allowInCarPlay])
    UNUserNotificationCenter.current().setNotificationCategories([category])

and also .carplay option when requesting notification authorization:

   UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge, .carPlay])

and set "CarPlay" for the categoryIdentifier in the push payload (it can be any string, just need to match what you used in UNNotificationCategory.