Run the following command to install the module (make sure to install the core module beforehand):
npm i @sentiance-react-native/crash-detection
Import the module
import SentianceCrashDetection from "@sentiance-react-native/crash-detection";
You can find a reference to all the types mentioned on this page .
Vehicle Crash Event Detection
Listen to vehicle crash events:
import {addVehicleCrashEventListener} from "@sentiance-react-native/crash-detection";
const subscription = addVehicleCrashEventListener(vehicleCrashEvent => {
// New vehicle crash event
});
// Don't forget to unsubscribe, typically in componentWillUnmount
subscription.remove();