Configuration
@objc(ZDConfiguration)
public class Configuration : NSObject, NSCopying
This class contains parameters required by Zendrive
during setup.
-
Your application key.
Pass in the application key for your app. If you don’t have one, please create one at https://developers.zendrive.com/signup
This field is REQUIRED and should be a valid string. Check
Zendrive.isValidInputParameter(_:)
to validate this field. Nil strings are not allowed. Passing invalid string would cause SDK setup to fail.Declaration
Swift
@objc public var applicationKey: String!
-
Unique ID for the current user. This can be any ID used by your app to identify its users. This is the ID which will be used in Zendrive reports. Use
Zendrive.isValidInputParameter(_:)
to verify that userId is valid.This field is REQUIRED and should be a valid string. Check
Zendrive.isValidInputParameter(_:)
to validate this field. Nil strings are not allowed. Passing invalid string would cause SDK setup to fail.Declaration
Swift
@objc public var driverId: String!
-
Attributes for the current user. These attributes are stored on the server and are provided in Zendrive’s APIs. Any existing attributes would be overwritten on the server when a non-nil value for this param is passed. Passing nil is a no-op.
Use this param to provide meta-information about the user like name, email, groupId or any custom attributes you wish to provide. Default value is nil.
Declaration
Swift
@objc public var driverAttributes: DriverAttributes?
-
Use this mode to control the SDK’s behaviour for detecting drives automatically. This mode can be changed at a later point using
Zendrive.setDriveDetectionMode(_:completionHandler:)
method.Applications which do not want the SDK to continuously track drives in background should set this value to
DriveDetectionMode.autoOFF
. With this, the application needs to callZendrive.startManualDrive(_:completionHandler:)
method to record drives. In case the application wants to enable auto drive detection only for a fixed duration (like when the driver is on-duty), use methodZendrive.setDriveDetectionMode(_:completionHandler:)
to change the mode toDriveDetectionMode.autoON
for that period and set it back toDriveDetectionMode.autoOFF
(once the driver goes off-duty).Declaration
Swift
@objc public var driveDetectionMode: DriveDetectionMode
-
Developers can set this property value to
false
to have complete control on the location permission User Experience.If set to
true
, Zendrive SDK would trigger location permission dialog on setup if permission is not available.ZendriveDelegate.processLocationApproved()
andZendriveDelegate.processLocationDenied()
callbacks are not sent to Zendrive delegate if this property is set tofalse
.The default value of this property is
true
.Declaration
Swift
@objc public var managesLocationPermission: Bool
-
Developers can set this property value to
false
to have complete control on the fitness and activity permission User Experience.If set to
true
, Zendrive SDK would trigger fitness and activity permission dialog on setup if permission is not available.The default value of this property is
true
.Declaration
Swift
@objc public var managesActivityPermission: Bool
-
Creates a Zendrive
Configuration
object.Declaration
Swift
@objc public override convenience init()
-
Creates a copy of Zendrive
Configuration
object.Declaration
Swift
@objc public func copy(with zone: NSZone? = nil) -> Any