Logo
  • Home
  • Funktionen
  • Über Uns
  • Blog
EN Experten Kontaktieren Login Get started for free

Delivery Event Management

The delivery events feature within the Android SDK is designed to be an integral component to optimize delivery processes. These events serve as digital records indicating when and where a delivery is planned. A delivery event should be created as soon as a customer places an order, capturing essential details like the delivery address and the earliest possible delivery date.

By registering delivery events at the order placement stage, applications enable the client (courier company) to retrieve the eventId and access critical information for efficient delivery planning. This data is anonymously collected and fed into sophisticated AI models, which help analyze patterns and optimize delivery schedules.

addDeliveryEvent

suspend fun addDeliveryEvent(latitude: Double, longitude: Double, dateTime: DateTime): ApiResponse<NewEventId>

The addDeliveryEvent method registers a delivery event when a customer places an order. It includes the delivery address and earliest delivery date, providing an eventId that couriers can use for planning. After the event is added, the method updates the list of delivery events to ensure the latest information is available.

return: ApiResponse<NewEventId> representing the unique identifier of the newly created delivery event.

val response = GCLocation.addDeliveryEvent(37.7749, -122.4194, DateTime.now())
if (response.isSuccessful) {
    println("Delivery event added with ID: ${response.result?.id}")
}

updateDeliveryEvent

suspend fun updateDeliveryEvent(event: DeliveryEvent): ApiResponse<String>

The updateDeliveryEvent method lets you modify an existing delivery event, such as updating the delivery address or earliest delivery date. This ensures delivery records stay accurate and up-to-date. After a successful update, the system refreshes the delivery events to sync with the latest server data.

return: ApiResponse<String> indicating whether the update operation was successful.

val event = DeliveryEvent("eventId", "geoHash", DateTime.now().millis)
val response = GCLocation.updateDeliveryEvent(event)
if (response.isSuccessful) {
    println("Delivery event updated successfully.")
}

deleteDeliveryEvent

suspend fun deleteDeliveryEvent(eventId: String): ApiResponse<String>

The deleteDeliveryEvent method removes a delivery event from the system using its unique event ID. This operation is crucial for maintaining clean data by eliminating incorrect or outdated event records. Successful deletion prompts an automatic refresh to load the current set of delivery events.

return: ApiResponse<String> confirming the deletion of the delivery event.

val response = GCLocation.deleteDeliveryEvent("eventId")
if (response.isSuccessful) {
    println("Delivery event deleted successfully.")
}

requestDeliveryEvents

suspend fun requestDeliveryEvents(): ApiResponse<List<DeliveryEvent>>

By calling requestDeliveryEvents, you can retrieve the complete list of delivery events stored on the server. This function is essential for gaining insights into your delivery operations, allowing for further data analysis and strategy refinement.

return: ApiResponse<List<DeliveryEvent>> containing the collection of delivery events available on the server.

val response = GCLocation.requestDeliveryEvents()
if (response.isSuccessful) {
    response.result?.forEach { event ->
        println("Delivery event ID: ${event.id}, GeoHash: ${event.geoHash}")
    }
}
Green convenience
  • Home
  • Funktionen
  • Über Uns
  • Blog
  • Kontakt
(+49) 151 57891073
c/o TechQuatier, Platz der Einheit 2, 60327 Frankfurt am Main
GDPR compliance

Certified Data Protection - GDPR compliance 02.12.2022

DatenschutzerklärungImpressum
Copyright © 2026  Green Convenience
↑