interface SentianceDrivingInsights {
    addDrivingInsightsReadyListener(onDrivingInsightsReady: ((drivingInsights: DrivingInsights) => void)): Promise<EmitterSubscription>;
    getAverageOverallSafetyScore(params: SafetyScoreRequestParameters): Promise<null | number>;
    getCallEvents(transportId: string): Promise<CallEvent[]>;
    getCallWhileMovingEvents(transportId: string): Promise<CallWhileMovingEvent[]>;
    getDrivingInsights(transportId: string): Promise<null | DrivingInsights>;
    getHarshDrivingEvents(transportId: string): Promise<HarshDrivingEvent[]>;
    getPhoneUsageEvents(transportId: string): Promise<PhoneUsageEvent[]>;
    getSpeedingEvents(transportId: string): Promise<SpeedingEvent[]>;
    getWrongWayDrivingEvents(transportId: string): Promise<WrongWayDrivingEvent[]>;
}

Methods

  • Adds a listener that will be invoked when the driving insights for a completed, non-provisional transport becomes ready.
    See this to learn more about what a provisional event is.

    Parameters

    • onDrivingInsightsReady: ((drivingInsights: DrivingInsights) => void)

      listener to receive the driving insights

        • (drivingInsights): void
        • Parameters

          Returns void

    Returns Promise<EmitterSubscription>

  • Returns the average overall safety score for a given set of parameters.

    Parameters

    Returns Promise<null | number>

    the average overall safety score, or null if a score is not available.

    Error if any of the inputs provided is invalid.

    import drivingInsights from "@sentiance-react-native/driving-insights";
    const params = {
    period: 7,
    transportModes: ["CAR", "BUS"],
    occupantRoles: "ALL_ROLES"
    }
    const avgOverallScore = await drivingInsights.getAverageOverallSafetyScore(params);
  • Returns the call events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<CallEvent[]>

  • Returns the call while moving events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<CallWhileMovingEvent[]>

    Use getCallEvents instead.

  • Returns the driving insights for a given non-provisional transport, or null if there are no driving insights, the transport ID is invalid or the transport is a provisional one.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<null | DrivingInsights>

  • Returns the harsh driving events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<HarshDrivingEvent[]>

  • Returns the phone usage events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<PhoneUsageEvent[]>

  • Returns the speeding events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<SpeedingEvent[]>

  • Returns the wrong way driving events for a completed, non-provisional transport.
    See this to learn more about what a provisional event is.

    Parameters

    • transportId: string

      the id of the desired transport

    Returns Promise<WrongWayDrivingEvent[]>