ZendriveAccidentInfo
@interface ZendriveAccidentInfo : NSObject
ZendriveAccidentInfo
Wrapper for meta-information related to an accident detected by the SDK.
-
The unique Id of drive during which the accident occured
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) NSString *driveId; -
The location of the accident.
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) ZendriveLocationPoint *accidentLocation; -
The timestamp of the accident in milliseconds since epoch.
Declaration
Objective-C
@property (nonatomic, readonly) long long timestamp; -
The session that was in progress when the accident occured, if a session was started in the SDK.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *sessionId; -
The tracking id of the ongoing drive when the accident occured.
See
+[Zendrive startManualDrive:completionHandler]Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *trackingId; -
The confidence of detected accident.
Declaration
Objective-C
@property (nonatomic, readonly) ZendriveAccidentConfidence confidence; -
A unique identifier of this accident.
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) NSString *accidentId; -
Measures an approximate precision of the detected collision. Ranges between 0 to 100.
Note: A confidence number of 0 indicated that it was not an accident. 0 confidence number can be sent as a part of final accident callback to invalidate the potential callback for the same accident. 0 confidence number will never come as a part of potential accident callback.
Checkout
-[ZendriveMockAccidentConfig invalidateFinalCallback]to test this scenario during development.Declaration
Objective-C
@property (nonatomic, readonly) int confidenceNumber; -
Vehicle type detected by SDK at the time of the accident.
ZendriveVehicleType.ZendriveVehicleTypeCaris the default value.Declaration
Objective-C
@property (nonatomic, readonly) ZendriveVehicleType vehicleType; -
Collision severity detected by SDK at the time of the accident.
ZendriveCollisionSeverity.ZendriveCollisionSeverityUnknownis the default value.Declaration
Objective-C
@property (nonatomic, readonly) ZendriveCollisionSeverity collisionSeverity; -
Direction of impact detected by SDK at the time of the accident.
ZendriveDirectionOfImpact.ZendriveDirectionOfImpactUnknownis the default value.Declaration
Objective-C
@property (nonatomic, readonly) ZendriveDirectionOfImpact directionOfImpact; -
-initWithLocation:timestamp: trackingId: sessionId: confidence: confidenceNumber: accidentId: driveId: vehicleType: collisionSeverity: directionOfImpact: Initializer for
ZendriveAccidentInfo.Declaration
Objective-C
- (nonnull id)initWithLocation:(nonnull ZendriveLocationPoint *)location timestamp:(long long)timestamp trackingId:(nullable NSString *)trackingId sessionId:(nullable NSString *)sessionId confidence:(ZendriveAccidentConfidence)confidence confidenceNumber:(int)confidenceNumber accidentId:(nonnull NSString *)accidentId driveId:(nonnull NSString *)driveId vehicleType:(ZendriveVehicleType)vehicleType collisionSeverity:(ZendriveCollisionSeverity)collisionSeverity directionOfImpact:(ZendriveDirectionOfImpact)directionOfImpact;Parameters
locationThe location of the accident
timestampThe timestamp of the accident in milliseconds since epoch
trackingIdThe tracking id of the ongoing drive when the accident occured
sessionIdThe session that was in progress when the accident occured, if a session was started in the SDK
confidenceConfidence measure of the detected accident
confidenceNumberConfidence number of the detected accident
accidentIdA unique identifier of this accident
driveIdThe unique Id of drive during which the accident occured
vehicleTypeVehicle type detected by SDK at the time of the accident
collisionSeverityCollision severity detected by SDK at the time of the accident
directionOfImpactDirection of impact detected by SDK at the time of the accident
Return Value
ZendriveAccidentInfoobject -
Returns a dictionary that represents the
ZendriveAccidentInfoobject.Declaration
Objective-C
- (nonnull NSDictionary *)toDictionary; -
Returns a JSON formatted string that represents the
ZendriveAccidentInfoobject.Declaration
Objective-C
- (nonnull NSString *)toJson;
ZendriveAccidentInfo Class Reference