interface SentianceCrashDetection {
    addVehicleCrashDiagnosticListener(onVehicleCrashDiagnostic: ((diagnostic: VehicleCrashDiagnostic) => void)): Promise<EmitterSubscription>;
    addVehicleCrashEventListener(onVehicleCrash: ((crashEvent: CrashEvent) => void)): Promise<EmitterSubscription>;
    invokeDummyVehicleCrash(): Promise<boolean>;
    isVehicleCrashDetectionSupported(): Promise<boolean>;
    listenVehicleCrashEvents(): Promise<boolean>;
}

Methods

  • Registers a listener that is invoked when vehicle crash diagnostic data becomes available.

    Use this function to receive diagnostic data while vehicle crash detection is running.

    Parameters

    Returns Promise<EmitterSubscription>

    a subscription object that you can use to unregister the listener you previously set.

  • Registers a listener that is invoked when a vehicle crash is detected.

    Parameters

    • onVehicleCrash: ((crashEvent: CrashEvent) => void)

      the callback to be invoked when a vehicle crash is detected.

        • (crashEvent): void
        • Parameters

          Returns void

    Returns Promise<EmitterSubscription>

    a subscription object that you can use to unregister the listener you previously set.

  • Invokes a dummy vehicle crash event. Use this method to test your vehicle crash detection integration.

    Calling this method will invoke the listener you previously set via addVehicleCrashEventListener (if any).


    Note that this method is intended only for testing your integration. It will not generate a real vehicle crash.

    Returns Promise<boolean>

  • Returns whether vehicle crash detection is supported on the device.


    The result depends on multiple criteria, such as if vehicle crash detection is enabled for the user, and if the necessary sensors are present on the device. As such, make sure a Sentiance user has been created before calling this function. Otherwise, the result will always be false.

    Returns Promise<boolean>

    true if vehicle crash detection is supported.

  • Returns Promise<boolean>

    Use addVehicleCrashEventListener instead