# DriveKit 3.0 migration guide

## What's changed in v3.0?

### Introduction

Version 3.0 of the DriveKit SDK contains breaking changes: all methods that were marked as deprecated during the past year have been permanently removed.

This guide lists every removed element alongside its recommended replacement, organized by module.&#x20;

Following these steps will keep your integration stable and future-proof.

{% hint style="info" %}
This version also features a newly available callback to retrieve the beacon detected and confirmed during trip recording which will not be presented in this migration guide.
{% endhint %}

### How to use this guide

Each section maps to an SDK module. For every removed element, you'll find:

* The exact method, class, or property that was removed
* The recommended drop-in replacement to use instead

## Module-level reset() methods

The `reset()` method has been removed from every individual module. Use `DriveKit.reset()` as your single reset point across all modules.

| Removed in v3.0                   | What to do instead           |
| --------------------------------- | ---------------------------- |
| DriveKitDriverData.reset()        | Call DriveKit.shared.reset() |
| DriveKitChallenge.reset()         | Call DriveKit.shared.reset() |
| DriveKitCoaching.reset()          | Call DriveKit.shared.reset() |
| DriveKitDriverAchievement.reset() | Call DriveKit.shared.reset() |
| DriveKitGroup.reset()             | Call DriveKit.shared.reset() |
| DriveKitTripAnalysis.reset()      | Call DriveKit.shared.reset() |
| DriveKitVehicle.reset()           | Call DriveKit.shared.reset() |

## DriveKitTripAnalysis

Several one-off methods have been merged into a single, structured call: `getCurrentTripInfo()`. This reduces the number of calls you need to make and gives you all the context about the current trip in one place.

| Removed in v3.0                     | What to do instead                                                                                            |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| getCurrentStartMode() -> StartMode? | getCurrentTripInfo() → access .startMode                                                                      |
| getCurrentTripStartDate() -> Date?  | getCurrentTripInfo() → access .startDate                                                                      |
| getLastTripPoint() -> TripPoint?    | getLastTripPointOfCurrentTrip()                                                                               |
| getTripResponseStatus(\_:)          | tripFinished(responseStatus:) — see [TripResponseStatus](/trip-analysis/ios/references.md#tripresponsestatus) |

### TripListener protocol — Updated Methods & Types

The `TripListener` protocol has been redesigned for clarity. The new methods provide richer state objects, so you get more context with less code.

#### **Method Replacements**

| Removed in v3.0                                                     | What to do instead                                           |
| ------------------------------------------------------------------- | ------------------------------------------------------------ |
| tripStarted(startMode: StartMode)                                   | tripRecordingConfirmed(state: DKTripRecordingConfirmedState) |
| tripCancelled(cancelTrip: CancelTrip)                               | tripRecordingCanceled(state: DKTripRecordingCanceledState)   |
| func tripFinished(post: PostGeneric, response: PostGenericResponse) | tripFinished(responseStatus: TripResponseStatus)             |

#### **Removed Classes & Enums**

These types were tightly coupled to the old listener design. They are no longer needed.

| Removed type in v3.0        | What to do instead                                                                                                    |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| CancelTrip (enum)           | State is now carried by [DKTripRecordingCanceledState](/trip-analysis/ios/references.md#dktriprecordingcanceledstate) |
| PostGeneric (class)         | No longer needed - the new API handles this internally                                                                |
| PostGenericResponse (class) | Replaced by the cleaner [TripResponseStatus](/trip-analysis/ios/references.md#tripresponsestatus)                     |

## DriveKitVehicle

A property has been converted to a method to support electric vehicle context.

| Removed in v3.0                              | What to do instead                   | Class             |
| -------------------------------------------- | ------------------------------------ | ----------------- |
| DKVehicleCategory.liteConfigDqIndex: String? | getLiteConfigDqIndex(isElectricCar:) | DKVehicleCategory |

## Data Access Layer (DB)

### DriveKitDBAchievementAccess

| Removed in v3.0 | What to do instead                          | Module          |
| --------------- | ------------------------------------------- | --------------- |
| .legacy         | No longer used - remove any reference to it | DKRankingPeriod |

### DriveKitDBTripAccess

The trip data classes have been renamed to follow the DK naming convention used across the SDK. This brings consistency and avoids naming collisions in your project.

| Removed in v3.0         | What to do instead                                                                                                                                                |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Trip (+ nested classes) | Use DKTrip - see [reference documentation](/trip-analysis/ios/references.md#dktrip)                                                                               |
| Route                   | Use DKRoute - see [reference documentation](https://docs.google.com/spreadsheets/d/1RYJ3e4FpzzB4jBxvjsHZefsxgwJO9GhFvexIywrV8Zo/edit?gid=201186400#gid=201186400) |

## UI Modules

### DriveKitCommonUI

| Removed in v3.0                                   | What to do instead                                             |
| ------------------------------------------------- | -------------------------------------------------------------- |
| CircularProgressView\.getScoreColor(value:steps:) | ConfigurationCircularProgressView\.getScoreColor(value:steps:) |
| ScoreType (enum)                                  | DKScoreType - same enum, new consistent name                   |
| DKScoreType.image() -> UIImage?                   | DKScoreType.gaugeImage() - clearer intent                      |

### DriveKitPermissionsUtilsUI

Logging control is now centralized in the DriveKit Core module — no longer split across the UI module.

| Removed in v3.0               | What to do instead                                 |
| ----------------------------- | -------------------------------------------------- |
| showDiagnosisLogs             | DriveKit.shared.isLoggingEnabled()                 |
| configureDiagnosisLogs(show:) | DriveKit.shared.enableLogging() / disableLogging() |
| configureBluetooth(needed:)   | Removed - no replacement needed, safe to delete    |

#### DriveKitVehicleUI

| Removed in v3.0                             | What to do instead                                |
| ------------------------------------------- | ------------------------------------------------- |
| configureVehiclePickerExtraStep(extraStep:) | Removed - no replacement, safe to delete the call |
| DKVehiclePickerExtraStep (protocol)         | Removed - safe to delete any conformance          |

### DriveKitDriverDataTimelineUI

| Removed in v3.0                                     | What to do instead           |
| --------------------------------------------------- | ---------------------------- |
| DriveKitDriverDataTimelineUI.scores: \[DKScoreType] | Use DriveKitUI.shared.scores |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/get-started-drivekit/ios/drivekit-3.0-migration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
