AccidentInfo
@objc(ZDAccidentInfo)
public class AccidentInfo : NSObject
Wrapper for meta-information related to an accident detected by the SDK.
-
The unique Id of drive during which the accident occured
Declaration
Swift
@objc public var driveId: String { get }
-
The location of the accident.
Declaration
Swift
@objc public var accidentLocation: LocationPoint { get }
-
The timestamp of the accident in milliseconds since epoch.
Declaration
Swift
@objc public var timestamp: Int64 { get }
-
The session that was in progress when the accident occured, if a session was started in the SDK.
See also
Zendrive.startSession(_:)
Declaration
Swift
@objc public var sessionId: String? { get }
-
The tracking id of the ongoing drive when the accident occured.
Declaration
Swift
@objc public var trackingId: String? { get }
-
The confidence of detected accident.
Declaration
Swift
@objc public var confidence: AccidentConfidence { get }
-
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 potential accident callback to invalidate the previous callback final accident callback for the same accident. 0 confidence number will never come as a part of potential accident callback.
Checkout
MockAccidentConfig.invalidateFinalCallback()
to test this scenario during development.Declaration
Swift
@objc public var confidenceNumber: Int32 { get }
-
A unique identifier of this accident.
Declaration
Swift
@objc public var accidentId: String { get }
-
Vehicle type detected by SDK at the time of the accident. Default value is
VehicleType.car
.Declaration
Swift
@objc public var vehicleType: VehicleType { get }
-
This field specifies the collision severity at the time of potential accident callback and final accident callback.
Default value is
CollisionSeverity.unknown
.Declaration
Swift
@objc public var collisionSeverity: CollisionSeverity { get }
-
This field specifies the direction of impact at the time of potential accident callback and final accident callback.
Default value is
DirectionOfImpact.unknown
.Declaration
Swift
@objc public var directionOfImpact: DirectionOfImpact { get }
-
init(location:
timestamp: trackingId: sessionId: confidence: confidenceNumber: accidentId: driveId: vehicleType: collisionSeverity: directionOfImpact: ) Initializer for
AccidentInfo
.Declaration
Swift
@objc public init(location: LocationPoint, timestamp: Int64, trackingId: String?, sessionId: String?, confidence: AccidentConfidence, confidenceNumber: Int32, accidentId: String, driveId: String, vehicleType: VehicleType, collisionSeverity: CollisionSeverity, directionOfImpact: 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
AccidentInfo
object -
Returns a dictionary that represents the
AccidentInfo
object.Declaration
Swift
@objc public func toDictionary() -> [AnyHashable : Any]
-
Returns a JSON formatted string that represents the
AccidentInfo
object.Declaration
Swift
@objc public func toJson() -> String