DriverNotificationManager

class DriverNotificationManager(options: DriverNotificationManagerOptions = DriverNotificationManagerOptions.Builder().build()) : MapboxNavigationObserver

Manages driver notification providers and aggregates their notifications.

The DriverNotificationManager is responsible for managing multiple DriverNotificationProvider instances, collecting their notifications, and exposing them as a single flow of DriverNotification objects.

This class allows applications to dynamically attach and detach notification providers and observe the notifications they generate.

Parameters

options

configuration options for the manager

See also

for the base class of notification providers

for the base notification type

Constructors

Link copied to clipboard
constructor(options: DriverNotificationManagerOptions = DriverNotificationManagerOptions.Builder().build())

Functions

Link copied to clipboard
fun attachDriverNotificationProvider(vararg driverNotificationProviders: DriverNotificationProvider)

Attaches one or more DriverNotificationProvider instances to the manager.

Link copied to clipboard
fun detachDriverNotificationProvider(vararg driverNotificationProviders: DriverNotificationProvider)

Detaches one or more DriverNotificationProvider instances from the manager.

Link copied to clipboard

Observes the notifications generated by all attached providers.

Link copied to clipboard
open override fun onAttached(mapboxNavigation: MapboxNavigation)

Called when the manager is attached to a MapboxNavigation instance.

Link copied to clipboard
open override fun onDetached(mapboxNavigation: MapboxNavigation)

Called when the manager is detached from a MapboxNavigation instance.

Link copied to clipboard
fun start()

Starts DriverNotificationManager.

Link copied to clipboard
fun stop()

Stops DriverNotificationManager.