MapboxHistoryRecorder

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

See also

to enable the recorder.

to read the history files.

Functions

Link copied to clipboard

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

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

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.