How to programmatically determine if an iPhone is connected to the CarPlay?

Is there any way to programmatically determine if an iPhone is connected (via USB or Bluetooth) to the CarPlay system? Old method via MPPlayableContentDelegate seem to be deprecated in iOS 14. In docs there said "MP_DEPRECATED("Use CarPlay framework", ios(7.1, 14.0))"

But can anybody suggest how to exactly use it?

Thanks!

Check out http://developer.apple.com/carplay/ for more details on the CarPlay framework, including a developer guide and WWDC video!

When your app is launched in CarPlay, it will be notified by way of a CPInterfaceControllerDelegate callback.

I would like to know this to.

We want to be able to change our app behavior when the phone is connected to carplay (e.g disable video features), not wait for the user to launch the app in CarPlay (which they may never do).

How to programmatically determine if an iPhone is connected to the CarPlay?
 
 
Q