CustomWarningProvider

public protocol CustomWarningProvider : AnyObject

A protocol representing a provider of custom warnings based on vehicle position.

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • Returns the custom warning type identifier produced by this provider.

    The returned value corresponds to CustomWarning.customWarningType and Warning.customWarningType and is used to apply per-type configuration, such as notification distances.

    Declaration

    Swift

    func getCustomWarningType() -> Int32

    Return Value

    The custom warning type identifier for this provider.

  • Returns a list of custom warnings for the given vehicle position.

    This method evaluates the custom warning provider using the current vehicle position on the electronic horizon and returns the resulting custom warnings along with corresponding payload.

    Declaration

    Swift

    func getWarnings(currentSegment: SegmentData, previousSegment: SegmentData?) -> [CustomWarning]

    Parameters

    currentSegment

    Segment data representing the vehicle’s current position on the electronic horizon.

    previousSegment

    Segment data representing the vehicle’s previous position on the electronic horizon. This parameter may be null if no previous position information is available.

    Return Value

    A list of CustomWarning instances representing all applicable custom warnings. The list may be empty if no warnings apply.