I am working on my iPhone parking app (deployment at iOS 12). I've finished to develop CarPlay app using UIApplicationSceneManifest in Info.plist file.
I created CarPlaySceneDelegate class (conformed to CPTemplateApplicationSceneDelegate) as delegate for CarPlay and PhoneScene (conformed to UIWindowSceneDelegate) class for iPhone.
After that I mentioned that UIWindowSceneDelegate is available only fo version 13 and more. So this way app will unavailable for users with iOS 12.
After that I understood that possible to make it without scenes (to build CarPlay inAppDelegate). But it's possibly only for apps type navigation. If I change in entitlement com.apple.developer.carplay-parking to com.apple.developer.carplay-maps everything is working. But for parking app on phone loads, but when I open app in CarPlay simulator it crashes app with "Application does not implement CarPlay template application lifecycle methods in its scene delegate." error.
I didn't succeeded to find how to resolve this problem.
My question is: if it's possible to use CarPlay type parking with iOS 12? And if yes, as I understand, I shouldn't use scenes, how to launch app from AppDelegate, which methods I need to use? Thanks a lot in advance.
func application(_ application: UIApplication, didConnectCarInterfaceController interfaceController: CPInterfaceController, to window: CPWindow) {
self.interfaceController = interfaceController
self.carWindow = window
interfaceController.setRootTemplate(CPGridTemplate(title: "Template", gridButtons: [CPGridButton(titleVariants: ["Title"], image: UIImage.init(named: "door")!, handler: {button in
print("Tap")
})]), animated: true)
}
func application(_ application: UIApplication, didDisconnectCarInterfaceController interfaceController: CPInterfaceController, from window: CPWindow) {
print("[CARPLAY] DISCONNECTED FROM CARPLAY!")
}
@available(iOS 14.0, *)
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController, to window: CPWindow) {
}
@available(iOS 14.0, *)
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene, didDisconnect interfaceController: CPInterfaceController, from window: CPWindow) {
}