Migration Guide 2.0
Migration SDK from old versions
This section provides a comprehensive description of the API changes that occur during the upgrade. It is highly recommended to review this documentation when upgrading the SDK version in order to understand the differences in the API and make the necessary updates to your API calls according to the version disparities.
Migration to version 2.0.0
New SDK Requirements
- iOS 13.0 or later
Support Safety Vehicle Score V1.0
DriveMotion has added a new interface called TNAggregatedSafetyScoreCall which allows querying Safety Scores for a specified time range. This API has the following parameters:
startDatewhich mark the start date of the requested time range.endDatewhich mark the end date of the requested time range.- Optional
vinset if need request the specified in-car device, default is null. - Optional
intervalTypewhich allows get daily or weekly interval safety scores, default is null. - Optional
intervalFilteris used to customize the request if only need event or score in response, default isall.
In the trip and BasicTrip objects:
- Add new field
tripRatingto describes the trip rating in [1, 5] under current safety algorithm.
In the new added TripRating object:
- Field
ratingto display trip safety rating in [1, 5] integer value.
In the DriveScore object:
- Add new field
scoreinstead ofsafetyScoreto avoid misunderstanding on score type. - Mark
safetyScoreas deprecated and will be remove in some releases. - Add new field
scoreVersionto indicate current score version. - Add new field
scoreTypeto indicate the score is coaching score or safety score. - Add new field
scoreDetailto show more detail info on score explanation.
In the new added ScoreDetail object:
- Field
scoreStartDateto show the start date base on settings. - Field
scoreEndDateto show the end date base on request. - Field
scoreQualifiedto indicate the qualified or not. - Field
scoreUnqualifiedReasonto show the detail reason for unqualified safety score. - Field
scoreQualifiedCriteriato show the safety score minimum requirement.
Support Event Statistics For Individual Factors
To facilitate the use of Event statistical information for subsequent operations in applications, the EventStatistic object has added the following fields:
- Add field
distanceto show the event distance in meters. - Add field
durationto show the event duration in seconds.
Support Analytics Query Mode
To support query by user id or device id, the DriveMotionSettings object has added the new enum parameter AnalyticsQueryMode, default userBased mode:
- The
userBasedmode, the analytics api query data by the user id. - The
deviceBasedmode, the analytics api query data by the device id.
Support Query Trips by VIN
To support trip information categorization requests for different in-car devices, the following Analytics APIs have all added an optional "withVIN" parameter in the request. You can use this parameter to query trip information for the corresponding device.
The supported APIs include:
- TNAggregatedScoreRequest
- TNGetCumulativeScoreRequest
- TNGetLatestTripDetailRequest
- TNGetTripsRequest
Updating Time Ranges in Analytics APIs
In the prior version, when querying the analytics API using startDate and endDate, the system would automatically adjust the start date to 00:00:00 local time and the end date to 23:59:59 local time. However, to harmonize the query range with the analytics API that retrieves an aggregated safety score based on a custom time range defined by client, analytics APIs will no longer auto-adjust the time range in the request. External applications should make these adjustments before setting the request parameters.
TNDataSourceClient: setDefaultSpeedLimit(:)
DriveMotion SDK supports the functionality for external apps to set a default speed limit value in situations where road info is unavailable. When road info is UNKNOWN, this default value will be used as the speed limit for events and scoring. The unit of measurement is meters per second (m/s), and the SDK's built-in default value is 80 miles per hour (mph).
1 2 | |
1 2 | |