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.ZendriveVehicleTypeCar
is the default value.Declaration
Objective-C
@property (nonatomic, readonly) ZendriveVehicleType vehicleType;
-
Collision severity detected by SDK at the time of the accident.
ZendriveCollisionSeverity.ZendriveCollisionSeverityUnknown
is the default value.Declaration
Objective-C
@property (nonatomic, readonly) ZendriveCollisionSeverity collisionSeverity;
-
Direction of impact detected by SDK at the time of the accident.
ZendriveDirectionOfImpact.ZendriveDirectionOfImpactUnknown
is 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
location
The location of the accident
timestamp
The timestamp of the accident in milliseconds since epoch
trackingId
The tracking id of the ongoing drive when the accident occured
sessionId
The session that was in progress when the accident occured, if a session was started in the SDK
confidence
Confidence measure of the detected accident
confidenceNumber
Confidence number of the detected accident
accidentId
A unique identifier of this accident
driveId
The unique Id of drive during which the accident occured
vehicleType
Vehicle type detected by SDK at the time of the accident
collisionSeverity
Collision severity detected by SDK at the time of the accident
directionOfImpact
Direction of impact detected by SDK at the time of the accident
Return Value
ZendriveAccidentInfo
object -
Returns a dictionary that represents the
ZendriveAccidentInfo
object.Declaration
Objective-C
- (nonnull NSDictionary *)toDictionary;
-
Returns a JSON formatted string that represents the
ZendriveAccidentInfo
object.Declaration
Objective-C
- (nonnull NSString *)toJson;