The identifier of the transport for which feedback is being provided.
The correct occupant role.
A Promise that resolves with a result object that you can use to check whether feedback was successfully submitted, or if it failed for a certain reason.
Submits feedback about a vehicle crash, whether it was detected and reported by the Sentiance SDK or occurred in real life but was not detected.
The vehicle crash detection feedback.
A Promise that resolves with a result object that you can use to check whether feedback was successfully submitted, or if it failed for a certain reason.
This feedback is used by Sentiance to analyze incidents and improve the accuracy and reliability of future crash detections.
import {submitVehicleCrashDetectionFeedback} from "@sentiance-react-native/event-timeline";
const feedback: VehicleCrashDetectionFeedback = {
type: "CRASH",
crashTimeEpoch: 1761048047000,
wasCrashDetectedBySentiance: true,
crashLocation: {
latitude: 5.66,
longitude: -2.45
}
};
const result = await submitVehicleCrashDetectionFeedback(feedback);
switch (result) {
case "ACCEPTED": {
console.log("Feedback accepted.");
break;
}
case "INVALID_EVENT_DATE": {
console.warn("The provided event date is in the future, or too old.");
break;
}
case "INVALID_LOCATION": {
console.warn("The provided crash location was invalid.");
break;
}
case "FEEDBACK_ALREADY_PROVIDED": {
console.warn("Feedback already provided for an event with the given date.");
break;
}
case "NO_USER": {
console.warn("SDK not initialized with a user.");
break;
}
default: {
// Exhaustiveness check
const _exhaustive: never = result;
throw new Error(`Unhandled result: ${_exhaustive}`);
}
}
Submits feedback for the detected occupant role of a specified transport.