mapbox / mapbox/mapbox-navigation-ios
Allow application to insert visual instructions on demand
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
An application can call `RouteVoiceController.speak(_:)` at any time to interrupt any in-progress spoken instruction with a custom spoken instruction. However, there’s no way for the application to couple custom spoken instructions with custom visual instructions. #1530 added `VisualInstructionDelegate.label(_:willPresent:as:) ` for tweaking a visual instruction predefined by the Directions API, but not for inserting an arbitrary instruction midstream. In other words, the customization hook is passive, not active.
NavigationService is the class that informs the application that the user has passed a predefined visual instruction point, so it should also have a `present(_:duration:)` method that presents the given visual instruction for a certain duration. There may need to be a priority argument of some sort to determine whether the message can be interrupted by a predefined instruction.
This would be useful for application-specific messages that the developer may need to present midroute, independently of any spoken instructions that the Directions API knows the user needs to hear about. An example would be a reminder to take a break after prolonged use of the application, considering that the application may be in the foreground across multiple navigation sessions. The application could present a modal alert, but a message that fits into the existing banner UI would result in a less confusing – and safer – driver experience.
We should probably pair this new method with a `NavigationService.present(_:)` method that accepts a spoken instruction. The current method on RouteVoiceController works OK but is less discoverable there, and navigation service has to know about all the instructions if it is to effectively coordinate them.
/cc @mapbox/navigation-ios @riastrad
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading NavigationService, RouteVoiceController.speak(_:), and VisualInstructionDelegate.label(_:willPresent:as:) to understand how spoken and predefined visual instructions are coordinated. Define how NavigationService should present arbitrary visual and spoken instructions, including interruption priority, and consider the existing navigation presentation flow when determining completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100