Detecting CarPlay connection when app wakes in background via geofence

Our iOS app supports CarPlay capability with the Driving task. The app is also configured to wake in the background on geofence entry or exit events, even from a terminated (killed) state.

We would like to understand how to detect whether CarPlay is connected to the iPhone when the app wakes up or runs in the background. In this case, the CarPlay app is not actively running in the Car infotainment system foreground.

Requirement: The app should perform a background task only when CarPlay is connected, including when launched in the background or from a killed state due to a geofence trigger.

Could you please advise on the recommended way or API to determine CarPlay connection status in this background scenario?

Thanks for the support!

Detecting CarPlay connection when app wakes in background via geofence
 
 
Q