Reliable background trigger when CarPlay connects/disconnects (Driver Log Book App)

Hello everyone,
I am currently developing a simple driver log book app and I’m hitting a wall regarding a seamless user experience.
My goal is very straightforward: I want my app to be notified/triggered in the background as soon as CarPlay is activated or deactivated, so it can automatically start or stop tracking a trip.
Even with the official CarPlay entitlement granted, I cannot find a reliable API or workaround to achieve this. It feels like something that should be incredibly simple.
I know that Apple Shortcuts (Kurzbefehle) handles this beautifully—the automation triggers for CarPlay work great. However, from an app developer's perspective, this isn't a viable solution for production:

  1. The average user will never go through the hassle of manually creating a Shortcut automation just to make the app work.
  2. Third-party apps are not allowed to programmatically create or inject these automation triggers for the user.
    It’s quite disappointing because the OS clearly detects the state perfectly, but doesn't expose a clean way for eligible navigation/driving apps to act on it in the background.
    Has anyone found a robust workaround for this? Or is there a specific API within the CarPlay framework I am overlooking that allows background execution exactly at the moment of connection/disconnection?
    Appreciate any insights or feedback!

A workaround is to check the audio output device. But this has some caveats like you won't see CarPlay, when the user has AirPods active.
You can't enumerate available devices (at least I haven't seen the API yet). But you can get the currently active output without any additional entitlement.