Skip to main content

Get started

Refer to the Mapbox UX Framework install guide. This guide assumes your initial set up has been completed.

Configuration

The MapGPT feature is enabled by default. Without additional configuration, your app will benefit from a default experience that Mapbox has been building.

Dash.init(DashConfig.create(applicationContext, accessToken))

All extra customization is available within the mapGptConfig block, while building the DashConfig. As new features become available, their configuration will be available through the same configuration block. Enable the settings menu to be able to select the various configurations from inside the app.

val dashConfig = DashConfig.create(applicationContext, accessToken) {
mapGptConfig {
isEnabled = true
isSettingsMenuEnabled = true
avatar = PrebuiltMapGptAvatars.mapboxyAvatar
}
}

Runtime changes

Not all features are available for changing at runtime. The features available for runtime changes will be available through the applyUpdate block.

Dash.applyUpdate {
mapGptConfig {
isEnabled = false
}
}

Events

The UX Framework exposes events that are triggered by the voice assistant. If you would like to have an event available, reach out to Mapbox. We would be happy to expose an event that is useful for your use case.

Dash.controller.observeMapGptEvents().onEach { event ->
Log.d(TAG, ">> DashMapGptEvent | event = $event")
}.launchIn(viewModelScope)

Microphone permission

The UX Framework requests microphone permission to be able to listen to the user. The SDK will request the permission when the user first attempts to speak with the assistant. If the user denies the permission, the assistant will not be able to listen to the user. The user will need to go into the app settings and enable the microphone permission.

Was this page helpful?