ZendriveDelegate
@objc
public protocol ZendriveDelegate : NSObjectProtocol
                Delegate for Zendrive.
- 
                  
                  
Called on delegate in the main thread when
ZendriveSDK detects a potential start of a drive.Declaration
Swift
@objc optional func processStart(ofDrive startInfo: DriveStartInfo)Parameters
startInfoInfo about drive start. Refer to
DriveStartInfofor further details. - 
                  
                  
Called on delegate in the main thread when
ZendriveSDK resumes a drive after a gap.The gap in drive recording may occur due to an application restart by the OS, application kill and restart by a user, an application crash or other reasons. Drives started by calling
Zendrive.startManualDrive(_:completionHandler:)are always resumed and they will not end untilZendrive.stopManualDrive(_:)is called.Declaration
Swift
@objc optional func processResume(ofDrive resumeInfo: DriveResumeInfo)Parameters
resumeInfoInfo about drive resume. Refer to
DriveResumeInfofor further details. - 
                  
                  
Called on the delegate in the main thread when
ZendriveSDK detects a drive to have been completed.It is possible that
ZendriveSDK might decide at a later time that an ongoing trip was a falsely detected trip. In such scenarioprocessEnd(ofDrive:)will be invoked on delegate withDriveInfo.driveType set toDriveType.invalid.Every trip with
DriveInfo.driveType not set toDriveType.invalidwill receive a correspondingprocessAnalysis(ofDrive:)callback containing additional info related to this drive.Declaration
Swift
@objc optional func processEnd(ofDrive estimatedDriveInfo: EstimatedDriveInfo)Parameters
estimatedDriveInfoBest estimate info about the drive. Refer to
EstimatedDriveInfofor further details. - 
                  
                  
Called on the delegate in the main thread when
ZendriveSDK finishes full analysis of all valid drives returned fromprocessEnd(ofDrive:)callback.This will be called for all the
processEnd(ofDrive:)callbacks with the value ofDriveInfo.driveType not set toDriveType.invalid.This may contain additional or improved data over the
EstimatedDriveInforeturned fromprocessEnd(ofDrive:)Typically this callback will be fired within a few seconds after
processEnd(ofDrive:)callback but in some rare cases this delay can be really large depending on phone network conditions.This callback will be fired in trip occurrence sequence, i.e from oldest trip to the latest trip.
Declaration
Swift
@objc optional func processAnalysis(ofDrive analyzedDriveInfo: AnalyzedDriveInfo)Parameters
analyzedDriveInfoAnalyzed insights of the drive.
 - 
                  
                  
This callback is fired on the main thread when an accident is detected by the SDK during a drive. Any ongoing auto-detected/manual drives will be stopped after this point.
Declaration
Swift
@objc optional func processAccidentDetected(_ accidentInfo: AccidentInfo)Parameters
accidentInfoInfo about accident.
 - 
                  
                  
This callback is fired on main thread when location services are denied for the SDK. After this callback, drive detection is paused until location services are re-enabled for the SDK.
The expected behaviour is that the enclosing application shows an appropriate popup prompting the user to allow location services for the app.
The callback is triggered once every time location services are denied by the user and can be triggered in background or in foreground, depending on whether the SDK has enough CPU time to execute.
This callback is not sent if
Configuration.managesLocationPermissionvalue was set tofalseat setup.Declaration
Swift
@objc optional func processLocationDenied() - 
                  
                  
This method is called when location permission state is determined for the first time or whenever it changes. This callback is not sent if
Configuration.managesLocationPermissionvalue was set tofalseat setup.Declaration
Swift
@objc optional func processLocationApproved() - 
                  
                  
This callback is fired if activity and fitness permission is denied for the SDK. This callback is not sent if ‘Configuration.managesActivityPermission’ value was set to
falseat setupDeclaration
Swift
@objc optional func processActivityDenied() - 
                  
                  
This callback is fired if activity and fitness permission is approved for the SDK. This callback is not sent if ‘Configuration.managesActivityPermission’ value was set to
falseat setupDeclaration
Swift
@objc optional func processActivityApproved() 
        ZendriveDelegate Protocol Reference