defaultSync: if this value is used, the SDK will try to synchronize local trips with DriveQuant backend to get new streaks or modified streaks, and then return the streak list via the completionHandler.
cache: if this value is used, no synchronization will be performed and only streaks previously synchronized will be returned via the completionHandler.
StreakSyncStatus in the completionHandler can have 4 values:
noError: synchronization has been successfully performed.
cacheDataOnly: synchronizationType has been set to cache.
failedToSyncStreakCacheOnly: synchronization has failed, only streaks previously synchronized are returned.
syncAlreadyInProgress: a synchronization is in progress, only streaks previously synchronized are returned until the synchronization is finished.
Streak Theme identifier
Current streak result
Best streak result
Streak themes description
The themes and conditions to increment the sequences of the trip are the following:
PHONE_DISTRACTION: the driver has not handled his phone.
SAFETY: the safety score of the trip is higher or equal to 9.8.
SPEEDING: the speeding score of the trip is higher or equal to 9.8.
ACCELERATION: there wasn’t any harsh acceleration event during the trip.
BRAKE: there wasn’t any hard braking event during the trip.
ADHERENCE: there wasn’t any adherence threshold crossing during the trip.
Streak Result description
Total distance travelled during streak (in meters)
Total duration travelled during streak (in seconds)
Number of trips performed within streak
Date of the first trip of the streak
Date of the last trip of the streak
To get Driver badges, your have to call the following method:
If you set this value to 5, the leaderboard will display:
the top 5 users in the ranking
the position of the connected user
the positions of the 5 best neighbors of the connected user
the positions of the 5 worst neighbors of the connected user
Whether data are fetch locally or from server.
The DKRankingType enum values are:
The DKRankingPeriod enum values are:
weekly: In the case of a weekly classification, the trips considered for the calculation of the user's position are those made between Monday midnight and Sunday midnight. If the user has not driven during the week, he is not ranked.
monthly: In the case of a monthly ranking, the trips considered for the calculation of the user's position are those made between the first and last day of the month.. If the user has not driven during this period, he is not ranked.
allTime: This ranking takes into account all of the driver's trips.
RankingSyncStatus in the callback can have 5 values:
noError: Synchronization has been successfully performed.
cacheDataOnly: SynchronizationType has been set to cache.
failedToSyncRanking: Synchronization has failed, only rankings previously synchronized are returned.
syncAlreadyInProgress: A synchronization is in progress, only rankings previously synchronized are returned until the synchronization is finished.
userNotRanked: The user is not ranked.
Theme of the ranking
Period of the ranking
Position of the driver in the driversRanked list
Previous position of the driver in the ranking
List of the rated drivers
Total number of rated drivers
Unique identifier of the driver
Driver’s rank in the ranking.
This value is determined from the rounded score (to 2 decimal places). If two drivers have the same score, the one with the highest distance is considered as the first one.
Driver’s score (according to the theme).
It corresponds to the average of all trip scores made during the specified period.
Covered distance by the driver in the specified period
Ranking access conditions
To enter a ranking, a driver must have at least one scored trip during the ranking period.
The scores, distances and ranks are updated every hour.
If you need to reset Driver Achievement configuration (user logout for example), you can call the following method:
All data saved locally by the Driver Achievement SDK will be erased and default configuration will be restored.