requestRoadGraphDataUpdate

fun requestRoadGraphDataUpdate(callback: RoadGraphDataUpdateCallback)

Requests road graph data update and invokes the callback on result. Use this method if the frequency of application relaunch is too low to always get the latest road graph data. Recreate MapboxNavigation instance in the callback when updates are available:

mapboxNavigation.requestRoadGraphDataUpdate(object : RoadGraphDataUpdateCallback {
override fun onRoadGraphDataUpdateInfoAvailable(
isUpdateAvailable: Boolean,
versionInfo: RoadGraphVersionInfo?
) {
if (isUpdateAvailable) {
val currentOptions = mapboxNavigation.navigationOptions
MapboxNavigationApp.disable()
MapboxNavigationApp.setup(currentOptions)
}
}
})

Parameters

callback

callback to be invoked when the information about available updates is received. See RoadGraphDataUpdateCallback.