Skip to content

Migration Guide 3.18

Migration SDK from Old Versions

This section provides a detailed description of API changes introduced or removed in recent SDK upgrades.
We strongly recommend reading this documentation when upgrading the SDK version to understand the differences and update your API calls accordingly.

Migration to Version 3.18.0

Delivers a trip match statistics API so your app can query per-user trip counts grouped by Bluetooth match reason and associated peripheral names for a date range (cloud; uses the current telematics user from the SDK).

Added getTripMatchStatisticsRequest() on the analytics client. Cloud GET /omniscore/v1/users/{userId}/trips/match-statistics with start_time / end_time (epoch seconds); telematics user is resolved in the SDK. TNStandoutData now tolerates missing tripIds in contextual coaching payloads.

iOS (Swift)

1
2
3
4
5
6
7
8
let request = analyticsClient
  .getTripMatchStatisticsRequest()
  .startTime(startDate)
  .endTime(endDate)
  .build()
TNGetTripMatchStatisticsCall().execute(request: request!) { response, error in
  // response?.tripCount, response?.statistics: [String: [TNTripWithMatchInfo]]
}

Android (Kotlin)

1
2
3
4
5
val request = driveMotionAnalyticsClient.getTripMatchStatisticsRequest()
  .withStartTime(start)
  .withEndTime(end)
  .build()
GetTripMatchStatisticsCall().execute(request) { result -> /* result.getResult() */ }

After a configurable on-trip delay, notifies the app when Bluetooth cannot be read during recording because phone Bluetooth is off, the app has no permission, or both, while the trip continues.

Optional TNDriveMotionMonitorDelegate.onBluetoothUnavailableDuringTrip(_: TNBTUnavailableEvent) with TNBTUnavailableEvent / TNBTUnavailableCauseType. Configure optional btUnavailableTripThresholdSec in CommonConfig / dm_common_model (default 120 seconds).

1
2
3
func onBluetoothUnavailableDuringTrip(_ event: TNBTUnavailableEvent) {
  // event.tripId, event.cause
}

Add SDK API for Bluetooth setup confidence analysis and autobind suggestions

Existing getRecommendedPeripheralsRequest() flow: optionally call asset / withAsset (VIN or channel client id + AssetContext) before build() to merge cloud latest recommendations with local (cloud-first, cloud wins on duplicates; cloud failure → local only). Response adds optional linkedPeripheral and tripStatistics; peripherals entries may include confidence, connectedTripCount, isCloudRecommended. iOS: TNGetRecommendedPeripheralsRequest.build() always returns non-nil (per migration guide). Combine publisher emits merged snapshot first, then on peripheral changes.

iOS

1
2
3
let request = enrollmentClient.getRecommendedPeripheralsRequest()
  .asset(channelClientId, .global) // or VIN with .car
  .build()

Android (Kotlin)

1
2
3
enrollmentClient.getRecommendedPeripheralsRequest()
  .withAsset(assetId, assetContext)
  .build()