Task
Teliver sdk provides you the way to manage your drivers with features that holds a strong grip on your business by Task management. The task type can be of three types Pickup, Drop and Pickup/Drop.
A Pickup task can be used to assign your driver to pickup a parcel/item from the provided location.
A Drop task can be used to assign your driver to drop a parcel/item to the provided location.
A Pickup/Drop task can be used to make your driver both pickup and drop a parcel/item from the provided locations.
Availability
You can set your drivers availability using the below snippet to filter out unavailable drivers while assigning.
Utilize the boolean value as
true
that set the status of the driver as available.Utilize the boolean value as
false
that set the status of the driver as unavailable.
Driver Properties
In managing a huge delivery system you can categorize your driver’s list by assigning them a set of properties. The properties can be based on location he operates, Domain he operates, his work timings and so on based on your need.
For instance you can set a zone property to your driver by zones,
Here you are categorizing the driver by his zip code i.e. 600020. you can use this property to list your driver via api according to the set property.
Task Notification
Your driver will be notified via push notification when a task has been assigned. To know about implementing push notifications in Teliver, please go through notifications.
Utilize Teliver.isTeliverPush to approve the push is from the teliver sdk.
The command message should contain the message as “teliver_assign_task”.
The payload will contain the data about the task and so on.
You can build a notification here to the driver indicating new task arrival.
The Task
object contains everything that you would need for the task like task id, order id, type, pickup/drop location, contact details, time, notes etc.
Get Task
You can get your particular task contents by following a basic code.
To get list of all the task associated with driver based on the status can be listed by following method.
The underneath code piece will give you the assigned tasks.
To get tasks with multiple status, provide the status in comma separated string as like below.
Accept/Reject assigned tasks
When a task has been assigned to a driver, the driver can update the task by accepting it or by rejecting it. You can use the following two methods to accept or reject.
You can likewise reject the task incase of any inconvenience by the beneath code.
Start task
You can start the task by using the following code which inturn will update the status of the task to started
as well as create a trip with task id which is generated while creating the task. The task id can be used as tracking id to track the driver.
Complete task
You can set the task as complete by the accompanying straightforward code.
Update status
You can update the status of individual pickup and drop status before completing by following methods.
This code works to updates a pickup task and sets isComplete = true, in the pickup object.
This updates a drop task and sets isComplete = true in drop object.
Last updated