Skip to content

Commit

Permalink
Fixed behavior when completion was not called in case of an error in …
Browse files Browse the repository at this point in the history
…CarPlayManager (#4548)
  • Loading branch information
kried authored Sep 18, 2023
1 parent 83f89e0 commit b92d1b7
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes to the Mapbox Navigation SDK for iOS

## v2.17.0

### CarPlay

* Fixed behavior when completion was not called in case of an error in CarPlayManager. ([#4548](https://github.com/mapbox/mapbox-navigation-ios/pull/4548))

## v2.16.0

### Packaging
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"object": {
"pins": [
{
"package": "CwlCatchException",
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
"state": {
"branch": null,
"revision": "3b123999de19bf04905bc1dfdb76f817b0f2cc00",
"version": "2.1.2"
}
},
{
"package": "CwlPreconditionTesting",
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state": {
"branch": null,
"revision": "a23ded2c91df9156628a6996ab4f347526f17b6b",
"version": "2.1.2"
}
},
{
"package": "MapboxCommon",
"repositoryURL": "https://github.com/mapbox/mapbox-common-ios.git",
"state": {
"branch": null,
"revision": "419bbceb7016eb6f8ca9f575d45508d9d948af30",
"version": "23.8.0"
}
},
{
"package": "MapboxCoreMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-core-maps-ios.git",
"state": {
"branch": null,
"revision": "d47a6e081b9ae736003033b971bfa641e650e08e",
"version": "10.16.0"
}
},
{
"package": "MapboxDirections",
"repositoryURL": "https://github.com/mapbox/mapbox-directions-swift.git",
"state": {
"branch": null,
"revision": "3aaab4fb516638c51ec8a2e73cd2fabdb4588622",
"version": "2.11.1"
}
},
{
"package": "MapboxMobileEvents",
"repositoryURL": "https://github.com/mapbox/mapbox-events-ios.git",
"state": {
"branch": null,
"revision": "91ae071c0232c144251dfe0d0724525deaf293d4",
"version": "1.0.10"
}
},
{
"package": "MapboxMaps",
"repositoryURL": "https://github.com/mapbox/mapbox-maps-ios.git",
"state": {
"branch": null,
"revision": "41c6ed63c77100371a54f5bf74cfffd3fc9f57fa",
"version": "10.16.0"
}
},
{
"package": "MapboxNavigationNative",
"repositoryURL": "https://github.com/mapbox/mapbox-navigation-native-ios.git",
"state": {
"branch": null,
"revision": "28c54bb4002ca16d60004c1abad2850240a4d149",
"version": "157.0.0"
}
},
{
"package": "MapboxSpeech",
"repositoryURL": "https://github.com/mapbox/mapbox-speech-swift.git",
"state": {
"branch": null,
"revision": "a9ef284deae227c6111c27a3535098c1e9a9d8e3",
"version": "2.1.1"
}
},
{
"package": "MapboxGeocoder",
"repositoryURL": "https://github.com/mapbox/MapboxGeocoder.swift.git",
"state": {
"branch": null,
"revision": "10c497840c9e1142194563f402ddc903310a935d",
"version": "0.15.0"
}
},
{
"package": "OHHTTPStubs",
"repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs.git",
"state": {
"branch": null,
"revision": "12f19662426d0434d6c330c6974d53e2eb10ecd9",
"version": "9.1.0"
}
},
{
"package": "Polyline",
"repositoryURL": "https://github.com/raphaelmor/Polyline.git",
"state": {
"branch": null,
"revision": "353f80378dcd8f17eefe8550090c6b1ae3c9da23",
"version": "5.1.0"
}
},
{
"package": "Solar",
"repositoryURL": "https://github.com/ceeK/Solar.git",
"state": {
"branch": null,
"revision": "c2b96f2d5fb7f835b91cefac5e83101f54643901",
"version": "3.0.1"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version": "1.2.3"
}
},
{
"package": "SnapshotTesting",
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state": {
"branch": null,
"revision": "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
"version": "1.9.0"
}
},
{
"package": "Turf",
"repositoryURL": "https://github.com/mapbox/turf-swift.git",
"state": {
"branch": null,
"revision": "f0afe204b4266337066a436becab62fdd2b32378",
"version": "2.7.0"
}
}
]
},
"version": 1
}
10 changes: 8 additions & 2 deletions Sources/MapboxNavigation/CarPlayManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,10 @@ extension CarPlayManager: CPMapTemplateDelegate {
animated: Bool,
completion: ((Bool, Error?) -> Void)? = nil) {
guard let interfaceController = interfaceController,
interfaceController.templates.count > 1 else { return }
interfaceController.templates.count > 1 else {
completion?(false, nil)
return
}

if #available(iOS 14.0, *) {
interfaceController.popToRootTemplate(animated: animated, completion: completion)
Expand All @@ -1039,7 +1042,10 @@ extension CarPlayManager: CPMapTemplateDelegate {
rootTemplate: CPTemplate,
animated: Bool,
completion: ((Bool, Error?) -> Void)? = nil) {
guard let interfaceController = interfaceController else { return }
guard let interfaceController = interfaceController else {
completion?(false, nil)
return
}

if #available(iOS 14.0, *) {
interfaceController.setRootTemplate(rootTemplate,
Expand Down

0 comments on commit b92d1b7

Please sign in to comment.