Allow for displaying an instruction banner that's not coming from the route response when initializing
Tracks adding an ability for the MapboxManeuverApi to generate Maneuver list with banner instruction objects that are not actually in the route object, for example a "Proceed to route start" banner that is returned by RouteProgress#bannerInstructions while RouteProgress#currentState is INITIALIZED which should be prepended to the list of the maneuvers.
cc @abhishek1508
@abhishek1508 mentioned that it would be more straightforward to implement the banner directly in the navigation SDK than in navigation-native. I agree, since we already have infrastructure set up for localization at the SDK level, and (at least on iOS) we already customize the banner’s contents on the arrival step. Besides, consuming banner contents from navigation-native would be more challenging on iOS, where we’re currently just consuming banner indices from navigation-native.
Capturing more from this slack thread, my idea is a bit different.
Regarding this approach, I had something little different in mind. Is there a way nav-native could tell SDK that you are not on your route? Maybe via INITIALIZED state, This way developers could register to this event via the SDK, Upon emission of this event, developers could inject any string they want to the list of banners. This will solve 2 problems:
- Developers could choose their own string to inject and hence translation. Otherwise, there might be requests from customers to use a different string. In that case, we would have to expose some sort of public API that would allow them to do so.
- Not all customers might want to do something like this. In that case we might have to make it configurable.
I am not saying that both these problems couldn't be addressed on the SDK. I just don't think we have enough data to make an opinion on this behavior and specifically on NavNative side. The ask in this ticket is not as simple as the ability to add an additional instruction in the list of maneuvers, but rather this would be marked done only when we allow customers to change the string at runtime and make it configurable.
We should probably think more about it and device a solution where nav native could inform about the scenarios when the user is not on route. This way, end developers could define their own behaviors and leverage the feature to inject a custom string in list of maneuvers.
/cc @LukasPaczos @1ec5
That makes sense to me - we can inject an additional generic "Proceed to route start" instructions when INITIALIZED state is detected with usage of MapboxManeuverApi#getManeuvers(RouteProgress). We should also add an option to disable this injection in case it's not desirable or if developers would like to use a different message.