Is there an existing issue for this?
Use case
First, I'd like to thank all the contributors for your work on this library. Much appreciated.
In my application I'd like to use a custom voice to enhance the navigation. To do this I set the AudioGuidanceType to silent:
navigationController.setAudioGuidanceType(AudioGuidance.SILENT);
After starting the guidance, I use the onTurnByTurn callback to provide the user with directions when necessary.
const onTurnByTurn = useCallback((turnByTurnEvent) => {
// provide user with next direction based on distance from currentStep
}, []);
const navigationCallbacks = useMemo(
() => ({
onTurnByTurn,
}),
[onTurnByTurn],
);
useEffect(() => {
addListeners(navigationCallbacks);
return () => {
removeListeners(navigationCallbacks);
}
};
}, [navigationCallbacks, addListeners, removeListeners]);
When the app is active it all works as expected. The problem is that the onTurnByTurn callback is not triggered when the app is in the background. I'd like to still provide the user with the directions when the application is in the background.
The native audio guidance (the one i set to silent) does provide directions when the application is in the background.
I was thinking a workaround might be to get the next navigation step when onRemainingTimeOrDistanceChanged is called, since this function does get called when the app is in the background. But I found no way to fetch the next navigation step on demand.
Proposal
Either to execute the onTurnByTurn callback when the application is in the background as well as in the foreground. Or provide a way to fetch the data provided by TurnByTurnEvent on demand.
Is there an existing issue for this?
Use case
First, I'd like to thank all the contributors for your work on this library. Much appreciated.
In my application I'd like to use a custom voice to enhance the navigation. To do this I set the AudioGuidanceType to silent:
navigationController.setAudioGuidanceType(AudioGuidance.SILENT);After starting the guidance, I use the
onTurnByTurncallback to provide the user with directions when necessary.When the app is active it all works as expected. The problem is that the
onTurnByTurncallback is not triggered when the app is in the background. I'd like to still provide the user with the directions when the application is in the background.The native audio guidance (the one i set to silent) does provide directions when the application is in the background.
I was thinking a workaround might be to get the next navigation step when
onRemainingTimeOrDistanceChangedis called, since this function does get called when the app is in the background. But I found no way to fetch the next navigation step on demand.Proposal
Either to execute the
onTurnByTurncallback when the application is in the background as well as in the foreground. Or provide a way to fetch the data provided byTurnByTurnEventon demand.