Skip to content

Commit cef7a27

Browse files
authored
Do not play reroute sound before reroute (#4808)
1 parent f42eb2e commit cef7a27

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes to the Mapbox Navigation SDK for iOS
22

3+
## v2.20.4
4+
5+
### Other changes
6+
7+
* Reroute notification sound now plays only after a new route is successfully retrieved.
8+
39
## v2.20.3
410

511
### Routing

Sources/MapboxNavigation/RouteVoiceController.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,12 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate {
8585

8686
func observeNotifications(by service: NavigationService) {
8787
NotificationCenter.default.addObserver(self, selector: #selector(didPassSpokenInstructionPoint(notification:)), name: .routeControllerDidPassSpokenInstructionPoint, object: service.router)
88-
NotificationCenter.default.addObserver(self, selector: #selector(pauseSpeechAndPlayReroutingDing(notification:)), name: .routeControllerWillReroute, object: service.router)
8988
NotificationCenter.default.addObserver(self, selector: #selector(didReroute(notification:)), name: .routeControllerDidReroute, object: service.router)
9089
NotificationCenter.default.addObserver(self, selector: #selector(didUpdateSettings(notification:)), name: .navigationSettingsDidChange, object: nil)
9190
}
9291

9392
func suspendNotifications() {
9493
NotificationCenter.default.removeObserver(self, name: .routeControllerDidPassSpokenInstructionPoint, object: nil)
95-
NotificationCenter.default.removeObserver(self, name: .routeControllerWillReroute, object: nil)
9694
NotificationCenter.default.removeObserver(self, name: .routeControllerDidReroute, object: nil)
9795
NotificationCenter.default.removeObserver(self, name: .navigationSettingsDidChange, object: nil)
9896
}
@@ -188,10 +186,7 @@ open class RouteVoiceController: NSObject, AVSpeechSynthesizerDelegate {
188186
public var rerouteSoundPlayer: AVAudioPlayer
189187

190188
@objc func didReroute(notification: NSNotification) {
191-
// Play reroute sound when a faster route is found
192-
if notification.userInfo?[RouteController.NotificationUserInfoKey.isProactiveKey] as! Bool {
193-
pauseSpeechAndPlayReroutingDing(notification: notification)
194-
}
189+
pauseSpeechAndPlayReroutingDing(notification: notification)
195190
}
196191
}
197192

0 commit comments

Comments
 (0)