LogoLogo
ProductsUse casesDocsSupport
  • Introducing DriveKit
  • DriveKit Guides
  • Get started with drivekit
    • Trip recording lifecycle
    • iOS
      • 🚀Quick start
      • Advanced configurations
      • References
      • iOS DriveKit Demo App
    • Android
      • 🚀Quick start
      • Advanced configurations
      • References
      • Android DriveKit Demo App
      • Android 15 Migration guide
      • Android 14 Migration guide
      • Troubleshooting
  • Trip analysis
    • Introduction
    • iOS
      • Permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (iOS)
    • Android
      • Runtime permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
      • Android
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
    • REST services
      • Trip
      • References
    • Trip Simulator
      • iOS
      • Android
  • PERMISSIONS UTILS
    • Introduction
    • User interface
      • iOS
        • Get started
        • Main configurations
      • Android
        • Get started
        • Main configurations
  • COMMON UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
    • References
  • DRIVER DATA
    • Introduction
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
      • Android
        • Get Started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
  • Driver Data Timeline UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • Vehicle
    • Introduction
    • iOS
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (iOS)
    • Android
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Main configurations
        • Advanced configurations
      • Android
        • Get started
        • Main configurations
        • Advanced configurations
  • DRIVER ACHIEVEMENT
    • Introduction
    • iOS
      • Get started
    • Android
      • Get Started
    • User interface
      • iOS
      • Android
  • CHALLENGE
    • Introduction
    • Important challenge rules
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
      • Android
        • Get started
  • GROUP
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • React Native
    • Get started
    • Integration
  • Flutter
    • Get started
    • Integration
  • Push services
    • Introduction
    • Push Trip Data
    • Push Deleted trip
    • Push Crash Data
    • Push Diagnosis Data
  • ADMIN SERVICES
    • Beacon
      • Add
      • Replace
      • Delete
      • Configuration
    • Challenges
      • List of challenges
      • Challenge details
      • Registered users
      • Challenge ranking
      • Users' progress
      • Definitions
    • Customer
      • Activity timeline
    • Driver
      • Timeline
      • Synthesis
      • Identity
      • Status
      • Add or update a metadata
      • Vehicles
      • Profile
      • Application diagnoses
    • Drivers
      • Account
      • Statistics
      • Ranking
      • Expired accounts
    • Group
      • Timeline
      • Synthesis
    • Trips
      • Add or update a metadata
      • Delete a metadata
    • Vehicle
      • Create
      • Characteristics
      • Configuration
      • Statistics
      • Update mileage
      • Tire and brake wear update
      • References
  • Crashes
    • Annotate a crash
    • Revoke crash location URL
  • ENTERPRISE SERVICES
    • Introduction
    • Teams
      • Create a team
      • List of teams
      • Enable or disable a team
    • Hyper-admins
      • Create a hyper-admin
      • List of hyper-admins
      • Delete a hyper-admin
    • Monitoring
      • Get a push trip data report
      • Get a push crash data report
      • Request to retry failed trips
      • Request to retry failed crashes
      • Get the status of a task
  • Release notes
    • Changelog
      • iOS
      • Android
      • UI iOS
      • UI Android
Powered by GitBook
On this page
  • Synchronize vehicle's odometer
  • Retrieve local vehicle’s odometer data
  • Add odometer history
  • Update odometer history
  • Delete odometer history

Was this helpful?

Export as PDF
  1. Vehicle
  2. iOS

Odometer

PreviousBluetooth device managementNextReferences (iOS)

Last updated 1 year ago

Was this helpful?

Methods presented in this part are available in the DriveKitVehicle class

Synchronize vehicle's odometer

You can retrieve the vehicle’s odometer data from the DriveQuant servers by calling the following method:

func getOdometer(
	vehicleId: String, 
	type: DKVehicleSynchronizationType = .defaultSync, 
	completionHandler: @escaping (DKOdometerSyncStatus, DKVehicleOdometer?, [DKVehicleOdometerHistory]?) -> Void
)

This method have the following parameters:

Name
Type
Description

vehicleId

String

The vehicle for which you want to get the odometer’s data

type

SynchronizationType

Can be defaultSync or cache.

- defaultSync will synchronize the vehicle’s odometer by calling the DriveQuant servers

- cache will retrieve the odometer data already synchronized in the local database.

, and models are described in the References part.

Retrieve local vehicle’s odometer data

You can retrieve the vehicle’s odometer data stored in the DriveKit local database by calling the previous method but with the type parameter to cache.

Add odometer history

You can add a new entry to a vehicle’s odometer by calling the following method:

func addOdometerHistory(
    vehicleId: String,
    distance: Double,
    completionHandler: @escaping (DKOdometerAddHistoryStatus, DKVehicleOdometer?, [DKVehicleOdometerHistory]?) -> Void
)

This method have the following parameters:

Name
Type
Description

vehicleId

String

The vehicle id for which you want to add an history entry

distance

Double

The distance in km you want to set

Update odometer history

To update an entry to a vehicle’s odometer, call the following method:

func updateOdometerHistory(
    vehicleId: String,
    historyId: String,
    distance: Double,
    completionHandler: @escaping (DKOdometerUpdateHistoryStatus, DKVehicleOdometer?, [DKVehicleOdometerHistory]?) -> Void
)

This method have the following parameters:

Name
Type
Description

vehicleId

String

The vehicle id for which you want to update the odometer’s data

historyId

String

The history id for which you want to update the distance.

distance

Double

The distance in km you want to update

Delete odometer history

To delete vehicle’s odometer entry, call the following method:

func deleteOdometerHistory(
    vehicleId: String,
    historyId: String,
    completionHandler: @escaping (DKOdometerDeleteHistoryStatus, DKVehicleOdometer?, [DKVehicleOdometerHistory]?) -> Void
)

This method have the following parameters:

Name
Type
Description

vehicleId

String

The vehicle id for which you want to delete the odometer’s history entry

historyId

String

The history id you want to delete

, and models are described in the References part.

, and models are described in the References part.

, and models are described in the References part.

DKOdometerSyncStatus
DKVehicleOdometer
DKVehicleOdometerHistory
DKOdometerAddHistoryStatus
DKVehicleOdometer
DKVehicleOdometerHistory
DKOdometerUpdateHistoryStatus
DKVehicleOdometer
DKVehicleOdometerHistory
DKOdometerDeleteHistoryStatus
DKVehicleOdometer
DKVehicleOdometerHistory