Advanced configurations

Maximum number of vehicles

A user can declare one or more vehicles. If you need to limit the number of configurable vehicle(s), you can set the parameter maxVehicles:

DriveKitVehicleUI.shared.configureMaxVehicles(max: Int?)

Settings:

  • A strictly positive integer

  • nil : If you do not want to limit the number of configurable vehicles.

Default value: nil

Authorization to add a vehicle

In some cases the vehicle can be pre-configured or you do not want the user to add a vehicle himself. Depending on your needs, it is possible to allow or restrict the vehicle to be added by the user. Call the following method to enable/disable the configuration:

DriveKitVehicleUI.shared.enableAddVehicle(enable: Bool)

Settings:

  • true: the user can add a vehicle

  • false: the user cannot add a vehicle

Default value: true

Configure vehicle actions

The Vehicle UI module lets you manage the actions available to the user that can be performed on the vehicle.

You can select the features that are visible and accessible to the user as well as the order in which these features are displayed. The possible actions are : delete the vehicle, replace the vehicle, rename the vehicle, technical data display and manage the vehicle mileage.

You can select which actions you want to display by calling the following method:

DriveKitVehicleUI.shared.configureVehicleActions(vehicleActions: [VehicleAction])

Settings:

  • delete: the user can delete the vehicle.

  • replace: the user can replace the vehicle.

  • rename: the user can rename the vehicle.

  • show: the user can display the vehicle characteristics.

  • odometer: the user can enter a mileage value manually.

Default values: [.show, .odometer, .replace, .rename, .delete]

Authorization to delete a beacon

If automatic trip recording with a beacon is mandatory in your application, you can block the deletion of a beacon and only allow its replacement. You can enable or disable this function using the parameter: allowDeletingBeacon.

Settings:

  • true: The user can delete a beacon

  • false: The user cannot delete a beacon

Default value: true

Select vehicle categories

The DriveKit Vehicle module contains a default category list (based on vehicle type). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in the car category list. You must not modify the value of the fields.

DriveKitVehicleUI.shared.configureVehicleCategories(categories: [DKVehicleCategory])

Settings:

Car:

  • micro

  • compact

  • sedan

  • suv

  • minivan

  • commercial

  • luxury

  • sport

Truck:

  • twoAxlesStraightTruck

  • threeAxlesStraightTruck

  • fourAxlesStraightTruck

  • twoAxlesTractor

  • threeAxlesTractor

  • fourAxlesTractor

Default values: All categories are displayed by default (depending on the type).

By default, the values are all in the list. They will be displayed depending on the selected types.

Select brands

The DriveKit Vehicle module contains a default brand list (based on vehicle category). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in this list. You must not modify the value of the fields.

You can choose which brands to display by calling the following method:

DriveKitVehicleUI.shared.configureBrands(brands: [DKVehicleBrand])

Settings:

  • DKVehicleBrand enum values

Default values: All brands are displayed by default.

Select engine types

The DriveKit Vehicle module contains a default engine type list (based on vehicle brand). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in this list. You must not modify the value of the fields.

You can choose which engine types to display by calling the following method:

DriveKitVehicleUI.shared.configureEngineIndexes(engineIndexes: [DKVehicleEngineIndex])

Settings:

  • gasoline

  • diesel

  • electric

  • gasolineHybrid

  • plugInGasolineHybrid

  • dieselHybrid

Default values: [.gasoline, .diesel, .electric, .gasolineHybrid, .plugInGasolineHybrid, .dieselHybrid]

Last updated