Tracking Trips
Trip Tracking is a powerful module designed for applications that need to track drivers' routes in real-time. By integrating the SDK into your application, you can record and manage the entire journey of a driver from start to finish.
Getting Started
Install the SDK
Before using the trip feature, you need to install the iOS Tracking SDK into your project. Please refer to Getting Started for a step-by-step guide.
Configure an Asset
Next, we will create an asset and bind it to a GPS device so that we can track the asset as it moves through its Trip.
Create an Asset
Bind an Asset
For comprehensive details about the above methods, please refer to the iOS SDK documents.
Implementing Trip Tracking
The trip feature in the Tracking SDK allows you to monitor and manage trips for your assets. This feature provides functionality for starting, updating, ending, and deleting trips, as well as retrieving trip summaries and details.
Starting a Trip
When a driver starts a trip, call the startTrip
method. This will record the start time and the starting location of the trip.
Updating Trip details
Ending a Trip
When a trip ends, such as when an order is picked up or a driver completes a delivery the driver reaches the destination or completes the last delivery of his route, you can mark a trip as completed, by calling the endTrip
method.
Retrieving Trip details
You can use the getAssetDetail method to get detailed information about a trip. If the provided trip IDis null, details of the ongoing trip are returned. Otherwise, if a valid trip ID is provided, details of the given trip are returned.
Get Trip Summary
Invoke tripSummaray
function to get the summary of a completed trip.
Deleting a Trip
You can delete a trip by providing the trip ID . However, note that once a trip is deleted, calling any other trip-related methods will no longer succeed.
Listening for Callback Methods
In addition to handling success or failure in method callbacks, you can also handle trip status changes by listening for delegates.
Setup the delegate
Implemente the delegate
By following these methods, you can easily integrate and use the Trip Tracking feature to achieve real-time tracking and management of driver trips.