DriverNotificationProvider

abstract class DriverNotificationProvider @RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP_PREFIX]) constructor(type: String) : MapboxNavigationObserver

Abstract base class for providing driver notifications.

This class serves as a parent for specific notification providers that generate and track notifications for drivers during navigation.

Subclasses of DriverNotificationProvider should implement the logic for generating notifications and provide a Flow of DriverNotification instances through the trackNotifications method.

Parameters

type

stable, unique key identifying the provider type. Enforces that only one provider of a given type is attached at a time. Must be a hardcoded constant per subclass. Do not derive it from javaClass or the class name: R8 class merging can make distinct providers share a runtime class, so class identity is not a reliable discriminator.

See also

for the base notification type.

Inheritors

Constructors

Link copied to clipboard
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP_PREFIX])
constructor(type: String)

Functions

Link copied to clipboard
abstract fun onAttached(mapboxNavigation: MapboxNavigation)
Link copied to clipboard
abstract fun onDetached(mapboxNavigation: MapboxNavigation)
Link copied to clipboard

Tracks notifications generated by the provider.