1

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) {
        
    }
Daniel
  • 11
  • 2
  • I think parking is only available on iOS 14+ so you won't be able to provide this feature to CarPlay user's that have iOS Devices with a lower OS version. If there were an entitlement that works below iOS 14 it wouldn't have carplay in its name (since the CarPlay framework is iOS 14+). For example Audio apps used to have `com.apple.developer.playable-content` and on iOS 14+ it's `com.apple.developer.carplay-audio` – fruitcoder Dec 01 '21 at 08:26
  • @Daniel did you find any solution for this issue? – Krima Shah Dec 16 '21 at 07:26
  • @KrimaShah, no, in my app carplay is accessable for ios 13 and higher – Daniel Jan 05 '22 at 09:30

0 Answers0