I am developing an iOS app that includes CarPlay usage. I have added the CarPlay entitlements given by apple to my app and when I launch the app it is shown in the CarPlay simulator as well, however when I run it I get the "Unable to connect to app" error screen. I have implemented the AppDelegate configurationForConnecting callback as instructed and added my CarPlay scene configuration in the info.plist
AppDelegate
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
print(connectingSceneSession.role)
if(connectingSceneSession.role == UISceneSession.Role.carTemplateApplication) {
let scene = UISceneConfiguration(name: "CarPlay", sessionRole: connectingSceneSession.role)
return scene
} else {
let scene = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
return scene
}
}
Info.plist (One of many combinations I tried)
However when I run the app the configurationForConnecting
is only called once and only for UIWindowSceneSessionRoleApplication
but It is never called for UISceneSession.Role.carTemplateApplication
. Interestingly if I also open an external display in the simulator I do get the UISceneSession.Role.windowExternalDisplay
in the callback.
Anyone else experienced a similar issue before?