In my app, I want to launch Apple Maps and start turn-by-turn navigation when the user taps a button.
I referred to Apple’s documentation and sample projects and implemented the following code:
if let url = URL(string: "maps://?t=m&daddr=(addr)") { self.carplayScene?.open(url, options: nil, completionHandler: nil) }
This works only if Apple Maps has been launched at least once on the iPhone or in the CarPlay environment. If Apple Maps has never been opened before, it launches the app but does not automatically start navigation.
However, once the user has opened Apple Maps at least once — either on the phone or through CarPlay — then navigation starts as expected from that point on.
Is this behavior expected? Or is it a bug?