iOS
Last updated
Was this helpful?
Last updated
Was this helpful?
The Driver Achievement UI SDK is available on Cocoapods master repo.
To access the framework in the repository, add the following lines to your Podfile:
Then, run pod install
.
If you have , the Driver Achievement UI module must also be manually initialized. In the application's AppDelegate file, import DriveKitDriverAchievementUI
.
Then, to initialize the Driver Achievement UI SDK in your app, you must call the initialization method in didFinishLaunchingWithOptions
method of your AppDelegate.
You can choose which streak theme you want to display in which order by calling the following method:
Accepted values:
.phoneDistraction
.safety
.acceleration
.brake
.adherence
.speedLimits
.call
Default value:
[.phoneDistraction, .safety, .acceleration, .brake, .adherence, .call]
For speedLimits streaks, make sure that the service is activated on your DriveQuant account.
To get the streak list view controller, you can call the following method:
You can choose which badge category you want to display in which order by calling the following method:
Accepted values:
.generic
.ecodriving
.safety
.phoneDistraction
Default value:
[.generic
, .ecodriving
, .safety
, .phoneDistraction
]
To show the badges list view controller, you can use the following method:
By calling the following method, you can choose which ranking types you want to display:
Accepted values:
.ecodriving
.safety
.distraction
.speeding
Default value:
[.safety
, .ecoDriving
, .distraction
]
This method allows you to change the displayed periods of ranking:
Accepted values:
.none
.period
Default value:.period(rankingPeriods: [.weekly, .monthly, .allTime])
This method allows you to choose the ranking depth you want to display:
Default value: 5
Accepted values: from 5 to 20
To display the ranking view controller, you can call the following method:
To override colors and texts in the Driver Achievement UI SDK, see .