Skip to content

Commit 111551d

Browse files
authored
Restore active navigation on CarPlay when it is connected (#3865)
1 parent 282feca commit 111551d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
### CarPlay
5353

5454
* Fixed an issue where an active navigation using CarPlay application with route that contains multiple legs would cause a memory leak. ([#3877](https://github.com/mapbox/mapbox-navigation-ios/pull/3877))
55+
* Added the `CarPlayManagerDelegate.carPlayManager(_:shouldUpdateNotificationFor:with:in:)` and `CarPlayManagerDelegate.carPlayManager(_:shouldShowNotificationFor:in:)` to provide the ability to control notifications presentation while CarPlay application is in the background. ([#3828](https://github.com/mapbox/mapbox-navigation-ios/pull/3828))
5556

5657
### Other Changes
5758
* During turn-by-turn navigation, incidents along the route are now refreshed periodically along with traffic congestion.

Example/AppDelegate+CarPlay.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ class CarPlaySceneDelegate: NSObject, CPTemplateApplicationSceneDelegate {
553553
appDelegate.carPlayManager.templateApplicationScene(templateApplicationScene,
554554
didConnectCarInterfaceController: interfaceController,
555555
to: window)
556+
// NOTE: When CarPlay is connected, we check if there is an active navigation in progress and start CarPlay
557+
// navigation as well, otherwise, CarPlay will be in passive navigation and stay out of sync with iOS app.
558+
if appDelegate.currentAppRootViewController?.activeNavigationViewController != nil {
559+
appDelegate.currentAppRootViewController?.beginCarPlayNavigation()
560+
}
556561
}
557562

558563
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,

0 commit comments

Comments
 (0)