EvBetterRouteNotificationProvider

class EvBetterRouteNotificationProvider(var options: EvBetterRouteNotificationOptions = EvBetterRouteNotificationOptions.Builder().build()) : DriverNotificationProvider

Provides notifications for better EV route alternatives.

This class is responsible for generating EvBetterRouteNotification instances when a better alternative route is found based on the state of charge (SoC) and the presence of EV charging waypoints.

The provider listens to route alternatives and evaluates the primary and alternative routes to determine if a better route is available. It uses the EvBetterRouteNotificationOptions to configure its behavior.

A better route is identified when the primary route cannot satisfy the expected SoC at the destination, but an alternative route does.

The provider continues to send notifications even if the user selects a worse route. Currently, filtering of this state should be handled by the application consuming this API.

Parameters

options

configuration options for the provider

See also

for the notification generated by this provider

for configuring the provider

Constructors

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

Properties

Link copied to clipboard

Functions

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

This method updates the internal state flow with the provided MapboxNavigation instance, allowing the provider to start tracking notifications.

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

Detaches the MapboxNavigation instance from the provider. This method clears the internal state flow by setting it to null, stopping the provider from tracking notifications.

Link copied to clipboard
open override fun trackNotifications(): Flow<DriverNotification>