Skip to content

Migration Guide 2.2

Migration SDK from old versions

This section will provide a detailed description of the API changes during the upgrade. We strongly recommend reading this documentation when upgrading the SDK version to understand the API differences and update your API calls accordingly based on the version disparities.

Migration to version 2.2.0

Support Score Created Time

If ConnectMode is Local, With or without scoreCreatedTime, nothing changes.

If ConnectMode is Cloud, The response will always contain scoreCreatedTime(UTC) from server, return this new attribute through SDK API.

In the GetAggregatedSafetyScore request, Add new attribute scoreCreatedTime to indicate when the safety score is calculated.

If without scoreCreatedTime in request, response keep current implementation to return latest safety score and statistics.

Inside the AggregatedSafetyScoreResponse scoredetail, also add new field scoreCreatedTime.

Note

Only support on CLOUD mode.

1
2
3
4
5
6
7
8
9
    let request = builder.withStartDate(#startDate#)
        .startDate(#endDate#)
        .endDate(#IntervalType#)
        .intervalType(#IntervalFilter#)
        .scoreCreatedTime(#Date#)
        .build()

    // score create time response from server(UTC)
    let scoreCreateTime = safetyScoreResponse.aggregatedSafetyScore?.score?.scoreDetail?.scoreCreatedTime

Support Trip Info Truncated Flag

In The TNGetTripsCall API response object TripInfo should return new attribute to indicate whether the trip gps is truncated or not. In the TripInfo object, add new Filed isAnonymized.

Support Aggregated Trips Info Time Range

In The TNAggregatedSafetyScoreCallTNAggregatedScoreCall, TNGetCumulativeScoreResponse API response object TNTripsInfo add new filed firstTripStartTime(UTC) and lastTripStartTime(UTC) identifies the start time of the first and last trip.

Support Data Retention Period

Now SDK can limit local storage on demand, SDK will purge local database automatically based on DataRetentionPeriod attribute (default value is YEAR) of TNDriveMotionSettings.

Support Trip Upload Monitor

TNDriveMotionMonitorClient mainly provides some monitor functions for trip upload status. TNDriveMotionMonitorClient Usage

Support Enable Live Trip Scoring

Set EnableLiveTripScoring attribute (default value is true) of TNDriveMotionSettings to false will disable live coaching score calculation, CPU usage can be reduced.

Support Get Simulated Safety Score

Now you can get simulated safety score by new analytics API TNGetSimulatedSafetyScoreCall. API Usage This api cloud mode is also supported, you can retrieve server-side simulated safety score by using ConnectionMode CLOUD. It just needs to add the connectionMode parameter when building the request.

Note

On CLOUD mode, ensure connection to an available network.

1
2
    let builder = driveMotionAnalyticsClient.withConnectionMode(mode:#connectionMode#).getSimulatedSafetyScoreRequest()
        ...