From b92d1b7d1e01ce567436eedefc3197daac42671d Mon Sep 17 00:00:00 2001 From: Nastassia Makaranka Date: Mon, 18 Sep 2023 16:40:41 +0200 Subject: [PATCH] Fixed behavior when completion was not called in case of an error in CarPlayManager (#4548) --- CHANGELOG.md | 6 + .../xcshareddata/swiftpm/Package.resolved | 151 ++++++++++++++++++ Sources/MapboxNavigation/CarPlayManager.swift | 10 +- 3 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 MapboxNavigation-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cba92ae62b..a6bc2d075fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/MapboxNavigation-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/MapboxNavigation-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000000..260d1ec68be --- /dev/null +++ b/MapboxNavigation-SPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -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 +} diff --git a/Sources/MapboxNavigation/CarPlayManager.swift b/Sources/MapboxNavigation/CarPlayManager.swift index 2b3dac94e35..c8afec83a7e 100644 --- a/Sources/MapboxNavigation/CarPlayManager.swift +++ b/Sources/MapboxNavigation/CarPlayManager.swift @@ -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) @@ -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,