MapboxHistoryRecorder

class MapboxHistoryRecorder

Provides a mechanism for saving and retrieving Mapbox navigation history files. Retrieve an instance of this class through MapboxNavigation.historyRecorder.

See also

Functions

Link copied to clipboard
fun fileDirectory(): String?

The file directory where the history files are stored. Use this to purge old history files, upload later, or to use them for replay.

Link copied to clipboard
fun pushHistory(eventType: String, eventJson: String)

Adds a custom event to the navigators history. This can be useful to log things that happen during navigation that are specific to your application.

Link copied to clipboard
fun startRecording()

Starts history recording session. If history recording is already started - does nothing. To save history and get a file path call MapboxHistoryRecorder.stopRecording.

Link copied to clipboard
fun stopRecording(result: SaveHistoryCallback)

When called, history recording will be stopped and all records will be added to the file. The path to the file will be sent to the SaveHistoryCallback.onSaved interface. If history recording was not started, SaveHistoryCallback is called with a null file path. MapboxHistoryRecorder.startRecording can be called before the SaveHistoryCallback completes.