I am devleoping navigation app for CarPlay and in iOS 12 there were two methods from CPApplicationDelegate to detect if CarPlay is on:
func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow)
and
func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow)
In iOS 13 these methods are deprecated and Apple gave new delegate: CPTemplateApplicationSceneDelegate
I have tried to connect this new delegate CPTemplateApplicationSceneDelegate to my service that provides all actions for CarPlay but only function I see that can help me is:
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration
So my question is how to detect if CarPlay is connected and how to provide action for CarPlay launched in one window of new iOS 13 CarPlay.