Hello everyone,
I am currently trying to build a CarPlay application with the Charging entitlement. As part of my application I have a List Template which shows different entries and should start navigation to one of them on click on it. Therefore I used the answer of this question: https://developer.apple.com/forums/thread/669838?login=true and implemented following function:
static func launchmap(cpAppScene: CPTemplateApplicationScene, latitude: String, longtitude: String, carplay : Bool = true) {
let urlString: String!
if UIApplication.shared.canOpenURL(URL(string:"comgooglemaps://")!) {
urlString = "comgooglemaps://?&daddr=\(latitude),\(longtitude)&directionsmode=driving"
} else {
urlString = "http://maps.apple.com/?daddr=\(latitude),\(longtitude)&dirflg=d"
}
if let url = URL(string: urlString) {
if (carplay) {
cpAppScene.open(url, options: nil, completionHandler: { (Void) in print("completed!")})
} else {
UIApplication.shared.open(url)
}
}
}
Now my main concern is: I can't test this functionality in the CarPlay simulator because it comes without safari and Apple Maps as well as I can't install any external apps like Google Maps. Trying to test this functionality in my car leads to it crashing and I am just frustrated on figuring out how to debug it without the simulator allowing us to install external apps and coming without maps.
Are there any ideas?
Thank you and best regards Dennis