Driving Insights
Prerequisites
The Driving Insights feature relies on additional library dependencies alongside the core SDK dependency. To start using this feature, you must first add these dependencies to you project.
Utilize the Driving Insights APIs
In this section, you can find examples of how to query the Sentiance SDK for driving insights, safe driving scores, detailed driving events. You will also find how to register to be notified of driving insights, once it becomes available.
Query for Driving Insights
To retrieve driving insights, use the getDrivingInsights method.
Query For Driving Events
The Sentiance SDK offers more granular driving insights. You can retrieve detailed events, such as speeding and harsh driving, as shown below.
Subscribe for Driving Insights Updates
To get driving insights updates even when your app is in the background, place the following code inside your app's entrypoint index.js file. If you're only interested in these updates when your app is foregrounded, place this code inside the appropriate UI code instead.
Create a background.dart file under your project's lib folder with the following code:
Add the following code, depending on your target platform.
For iOS, add the following to your app delegate class:
For Android, add this code to your custom application class:
Last updated