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 |
|
|
Scanning |
|
|
Results |
|
|
Error handling |
Legacy exceptions and response wrappers |
|
Feedback |
Feedback methods returning legacy response wrappers |
|
Initialization changes
In v14, initialization was exception-based.
In the current API, initialization is callback-based and returns SdkResult.
-
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)
}
-
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:
-
AnylineTireTreadhandles initialization, results, and feedback. -
AnylineTireTreadScannerhandles launching the scan UI.
If your v14 integration embeds a TireTreadScanView, remove that code and replace it with scanner.scan(…).
-
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)
}
-
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:
-
CompletedOutcomefor a successful scan -
AbortedOutcomewhen the user cancels -
FailedOutcomewhen the scan ends with anSdkError
Result retrieval
Result retrieval is no longer described through legacy response wrappers.
-
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)
}
-
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
visibletoggles
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(…)withAnylineTireTread.initialize(…) -
Replace
TireTreadScanViewand its callbacks withAnylineTireTreadScanner().scan(…) -
Replace
getTreadDepthReportResult(…)withgetResult(…) -
Move error handling to
SdkResult.ErrandSdkError -
Remove
countdownConfig,scanDirectionConfig,tireOverlayConfig,showMeasuringSpots, and oldvisibletoggles