Initialization and Configuration

Introduction

Documentation is provided through Swift.

Initialization

The library is initialized defining organization (client_id) and user unique identification (user_id)
Optionally configuration, user country, and vehicle can be set.

SygicDriving.sharedInstance().initialize(
withClientId: client_id, userId: user_id, configuration: configuration, vehicleSettings: vehicleSettings, countryIso: "FRA") { (error) in
         if let error = error {
                print("\(error.localizedDescription)")
         } else {
                SygicDriving.sharedInstance().delegate = self
                SygicDriving.sharedInstance().enableAutomaticTracking(true)
         }
}

Configuration

Several options can be provided mainly affecting online interactions with compute server.

let configuration = SygicDrivingConfiguration()
        configuration.disableGeofences = false
        configuration.dontUploadTrips = false
        configuration.sendInRoaming = false
        configuration.sendOnMobileData = true
SygicDriving.sharedInstance().update(configuration)

Vehicle settings

Vehicle can optionally be defined. This will affect scoring applied.

let vehicleSettings = SygicVehicleSettings()
        vehicleSettings.vehicleType = .car
        vehicleSettings.vehicleTrailers = 0
        vehicleSettings.vehicleHazmat = false
        vehicleSettings.vehicleMaxSpeed = 250
        vehicleSettings.vehicleFuelType = .diesel
        vehicleSettings.vehicleWeight = 1300
        vehicleSettings.vehicleLength = 5434
        vehicleSettings.vehicleAxles = 2
SygicDriving.sharedInstance().vehicleSettings = vehicleSettings