Migrating from SDK v14.x to v15+

Version 15 introduces a new top-level API shape for initialization, scanning, results, and error handling. If you are migrating from v14, this page highlights the main code changes to make in your integration.

It is also worth having a look at the Release Notes, the Scan Process page, and the Error Handling page for implementation details.

Android & iOS

API surface changes

Area v14 Current API

Initialization

AnylineTireTreadSdk.init(…​)

AnylineTireTread.initialize(…​)

Scanning

TireTreadScanView with onScanProcessCompleted, onScanAborted, and onError

AnylineTireTreadScanner().scan(…​) returning CompletedOutcome, AbortedOutcome, or FailedOutcome

Results

AnylineTireTreadSdk.getTreadDepthReportResult(…​)

AnylineTireTread.getResult(…​)

Error handling

Legacy exceptions and response wrappers

SdkResult.Ok / SdkResult.Err with SdkError.type, code, and message

Feedback

Feedback methods returning legacy response wrappers

sendCommentFeedback(…​), sendTireIdFeedback(…​), and sendTreadDepthResultFeedback(…​) returning SdkResult

Initialization changes

In v14, initialization was exception-based. In the current API, initialization is callback-based and returns SdkResult.

Old example
  • Android

  • iOS

try {
    AnylineTireTreadSdk.init(licenseKey = "<YOUR_LICENSE_KEY>", context = applicationContext)
} catch (exception: Exception) {
    showInitializationError(exception)
}
do {
    try AnylineTireTreadSdk.shared.init(licenseKey: "<YOUR_LICENSE_KEY>")
} catch {
    showInitializationError(error)
}
New example
  • Android

  • iOS

AnylineTireTread.initialize(
    context = applicationContext,
    licenseKey = "<YOUR_LICENSE_KEY>"
) { result ->
    when (result) {
        is SdkResult.Ok -> startScan()
        is SdkResult.Err -> showInitializationError(result.error)
    }
}
AnylineTireTread.shared.initialize(licenseKey: "<YOUR_LICENSE_KEY>") { result in
    if result.isOk {
        self.startScan()
    } else if let error = result.error {
        self.showInitializationError(error)
    }
}

Scan flow changes

The current API separates SDK lifecycle from scanning:

  • AnylineTireTread handles initialization, results, and feedback.

  • AnylineTireTreadScanner handles launching the scan UI.

If your v14 integration embeds a TireTreadScanView, remove that code and replace it with scanner.scan(…​).

Old example
  • Android

  • iOS

TireTreadScanView(
    config = customConfig,
    onScanAborted = ::onScanAborted,
    onScanProcessCompleted = ::showResult,
    callback = null,
    onError = { measurementUUID, exception ->
        showScanError(measurementUUID, exception)
    }
)
TireTreadScanViewKt.TireTreadScanView(
    config: customConfig,
    onScanAborted: onScanAborted,
    onScanProcessCompleted: showResult,
    callback: nil
) { measurementUUID, error in
    self.showScanError(uuid: measurementUUID, error: error)
}
New example
  • Android

  • iOS

val scanner = AnylineTireTreadScanner()

scanner.scan(from = activity, config = customConfig) { outcome ->
    when (outcome) {
        is CompletedOutcome -> showResult(outcome.measurementUUID)
        is AbortedOutcome -> onScanAborted()
        is FailedOutcome -> showScanError(outcome.measurementUUID, outcome.error)
    }
}
let scanner = AnylineTireTreadScanner()

scanner.scan(from: self, config: customConfig) { outcome in
    if let completed = outcome as? CompletedOutcome {
        self.showResult(uuid: completed.measurementUUID)
    } else if outcome is AbortedOutcome {
        self.onScanAborted()
    } else if let failed = outcome as? FailedOutcome {
        self.showScanError(uuid: failed.measurementUUID, error: failed.error)
    }
}

When the scan ends, handle exactly one ScanOutcome:

  • CompletedOutcome for a successful scan

  • AbortedOutcome when the user cancels

  • FailedOutcome when the scan ends with an SdkError

Result retrieval

Result retrieval is no longer described through legacy response wrappers.

Old example
  • Android

  • iOS

AnylineTireTreadSdk.getTreadDepthReportResult(
    measurementUuid = measurementUUID,
    timeoutSeconds = 60
) { response ->
    when (response) {
        is Response.Success -> renderResult(response.data)
        is Response.Error -> showResultError(response.errorMessage)
        is Response.Exception -> showException(response.exception)
    }
}
AnylineTireTreadSdk.shared.getTreadDepthReportResult(
    measurementUuid: measurementUUID,
    timeoutSeconds: 60
) { response in
    // Handle the legacy response wrapper here:
    // success -> render the returned TreadDepthResult
    // error / exception -> show the legacy failure state
    self.handleLegacyResultResponse(response)
}
New example
  • Android

  • iOS

AnylineTireTread.getResult(measurementUUID = measurementUUID, timeoutSeconds = 60) { response ->
    when (response) {
        is SdkResult.Ok -> renderResult(response.result)
        is SdkResult.Err -> showResultError(response.error)
    }
}
AnylineTireTread.shared.getResult(measurementUUID: measurementUUID, timeoutSeconds: 60) { response in
    if let result = response.result {
        self.renderResult(result)
    } else if let error = response.error {
        self.showResultError(error)
    }
}

Use getResult(measurementUUID, timeoutSeconds) to fetch the TreadDepthResult. It returns SdkResult, so read response.result on success and response.error on failure.

Feedback changes

Feedback remains measurement-based, but now follows the same SdkResult pattern as the rest of the API instead of the legacy response-wrapper model.

Use the measurement UUID from CompletedOutcome with:

  • sendCommentFeedback(…​)

  • sendTireIdFeedback(…​)

  • sendTreadDepthResultFeedback(…​)

ScanConfig changes

The following configuration fields were removed in v15 and must be deleted from migrated integrations:

  • uiConfig.countdownConfig

  • uiConfig.scanDirectionConfig

  • uiConfig.tireOverlayConfig

  • scanConfig.showMeasuringSpots

  • old element-level visible toggles

If you have these fields in code, remove those assignments. If your older config JSON contains these properties, remove them there as well.

Migration checklist

  • Replace AnylineTireTreadSdk.init(…​) with AnylineTireTread.initialize(…​)

  • Replace TireTreadScanView and its callbacks with AnylineTireTreadScanner().scan(…​)

  • Replace getTreadDepthReportResult(…​) with getResult(…​)

  • Move error handling to SdkResult.Err and SdkError

  • Remove countdownConfig, scanDirectionConfig, tireOverlayConfig, showMeasuringSpots, and old visible toggles