iOS
Integration
To add the Trip Simulator module to your app, add this dependency in the Podfile:
This component has been designed to facilitate preliminary testing and should never remain in your production app.
Usage
DriveQuant offers the possibility of running simulations from a list of preset trips. After integrating and activating the trip simulation component, you can select a preset trip from those described in the table below. Once the simulation is launched, the Trip Analysis SDK will receive the configured callbacks automatically.
Name | Duration | Distance | Description |
| 8 min | 2 km | Trip too short that does not allow to rate the driver's behavior |
| 15 min | 12 km | A 15-minute mixed trip in urban and suburban areas |
| 20 min | 8 km | A 20-minute city trip |
| 30 min | 30 km | A 30-minute trip performed in a suburban environment mostly |
| 55 min | 100 km | A 55-minute highway trip |
| 10 min | 5 km | Trip recorded in a train to test the alternative transportation modes detection |
| 13 min | 3 km | Trip recorded in a bus to test the alternative transportation modes detection |
| 40 min | 25 km | Trip recorded in a boat to test the alternative transportation modes detection |
| 5 min | 1 km | A trip to simulate an unconfirmed or a confirmed crash. |
| 23 min | 24 km | A trip to simulate an accident confirmed less than two minutes after the start of the trip, after which the driver continued driving. |
Simulate a trip
To simulate a trip, you just need to send the selected trip to the start
method:
Stop the simulation
To stop the simulation of a trip, you need to call the stop
method:
Simulate a crash during a trip
The simulation of a trip with a collision only works on a real device, not with the simulator.
In order to mock a crash to check your integration, you must call the startCrashTrip
function with a PresetCrashConfiguration
item as parameter. Possible values for PresetCrashConfiguration enumeration are described in the table below:
Name | Description |
---|---|
| A short trip with a collision at 30 km/h that occurs 137 seconds after the trip begins and that corresponds to a confirmed accident. |
| A short trip with a collision at 20 km/h that occurs 141 seconds after the trip begins and that corresponds to a confirmed accident. |
| A short trip with a collision at 10 km/h that occurs 146 seconds after the trip begins and that corresponds to a confirmed accident. |
| A short trip with a collision during a vehicle stop that occurs 159 seconds after the trip begins and that corresponds to an unconfirmed accident. |
| A trip to with a collision at 30km/h that occures 95 seconds after the trip begins and that corresponds to a confirmed accident, after which the driver continue driving. |
Last updated