HyperTrack

public class HyperTrack

The main entry point for the HyperTrack SDK

Types

Link copied to clipboard
public final class Cancellable
Link copied to clipboard
public class Destination

Defines the shape of a geofence destination for order tracking. Two types are supported: circular and polygonal.

Link copied to clipboard
public class Error
Link copied to clipboard
public final class Location
Link copied to clipboard
public class LocationError

The reason for why the SDK doesn't have a fresh location.

Link copied to clipboard
public final class LocationWithDeviation

The current location of the user and deviation from the expected location for the geotag.

Link copied to clipboard
public final class Order implements Comparable<HyperTrack.Order>

Order assigned to the worker

Link copied to clipboard
public final class OrdersMap implements Map<String, HyperTrack.Order>

A collection of orders that are currently assigned to the worker.

Link copied to clipboard
public class OrderStatus

Order event

Link copied to clipboard
public final class OrderTrackError
Link copied to clipboard
public class OrderTrackMode

Tracking mode of the order.

Link copied to clipboard
public final class TrackOrder

Represents an order to be sent for tracking.

Functions

Link copied to clipboard
final static Result<HyperTrack.Location, HyperTrack.LocationError> addGeotag(    String orderHandle,     HyperTrack.OrderStatus orderStatus,     Json.Object metadata)

Adds a new geotag with order status. Order status is used to identify the important moments during the fulfillment using custom labels (e.g clockIn, clockOut, login, accepted, started, arrived, completed, logout etc.). This provides the ability to filter and aggregate KPIs across geotags available through APIs and the Ops Views. Use geotags to mark a location at the current timestamp with custom metadata associated with this location.

final static Result<HyperTrack.LocationWithDeviation, HyperTrack.LocationError> addGeotag(    String orderHandle,     HyperTrack.OrderStatus orderStatus,     Json.Object metadata,     HyperTrack.Location expectedLocation)

Adds a new geotag with expected location and order status. Use geotags to mark a location at the current timestamp with custom metadata associated with this location. Order status is used to identify the important moments during the fulfillment using custom labels (e.g clockIn, clockOut, login, accepted, started, arrived, completed, logout etc.). This provides the ability to filter and aggregate KPIs across geotags available through APIs and the Ops Views. Expected location is used to calculate deviation distance of the actual location where the geotag was recorded from the expected place.

Link copied to clipboard
final Boolean getAllowMockLocation()
Link copied to clipboard
final static String getDynamicPublishableKey()
Link copied to clipboard
final static HyperTrack.OrdersMap getOrders()
Link copied to clipboard
final static HyperTrack.Cancellable locate(Function1<Result<HyperTrack.Location, Set<HyperTrack.Error>>, Unit> callback)

Gets the current location once it is available or returns a Set of Errors if it's not possible.

Link copied to clipboard
final Unit setAllowMockLocation(Boolean allowMockLocation)
Link copied to clipboard
final static Unit setDynamicPublishableKey(static String dynamicPublishableKey)
Link copied to clipboard
final static HyperTrack.Cancellable subscribeToErrors(Function1<Set<HyperTrack.Error>, Unit> callback)

Subscribe to the changes in the errors property (that indicates errors that can prevent the app from successfully tracking)

Link copied to clipboard
final static HyperTrack.Cancellable subscribeToIsAvailable(Function1<Boolean, Unit> callback)

Subscribe to the changes in the isAvailable property (that indicates availability of the device for the Nearby search)

Link copied to clipboard
final static HyperTrack.Cancellable subscribeToIsTracking(Function1<Boolean, Unit> callback)

Subscribe to the changes in the isTracking property (that indicates the tracking intent for the worker)

Link copied to clipboard
final static HyperTrack.Cancellable subscribeToLocation(Function1<Result<HyperTrack.Location, HyperTrack.LocationError>, Unit> callback)

Subscribe to the changes in the location property (that indicates the current location of the user)'

Link copied to clipboard
final static HyperTrack.Cancellable subscribeToOrders(Function1<HyperTrack.OrdersMap, Unit> callback)

Subscribe to the changes in the orders property (that indicates the orders assigned to the worker)

Properties

Link copied to clipboard
private Boolean allowMockLocation

Allows mock location(s).

Link copied to clipboard
private final static String deviceID

A string that is used to uniquely identify the device.

Link copied to clipboard
private static String dynamicPublishableKey
Link copied to clipboard
private final static Set<HyperTrack.Error> errors

A set of errors that can prevent the app from successfully tracking.

Link copied to clipboard
public final static HyperTrack INSTANCE
Link copied to clipboard
private final static Boolean isAvailable

Reflects availability of the device for the Nearby search

Link copied to clipboard
private final static Boolean isTracking

Reflects the tracking intent for the device

Link copied to clipboard
private final static Result<HyperTrack.Location, HyperTrack.LocationError> location

The current Location of the user or the Location.Error if the location is not determined.

Link copied to clipboard
private final static Json.Object metadata

Metadata associated with the device.

Link copied to clipboard
private final static String name

The name that is set for the device.

Link copied to clipboard
private final static HyperTrack.OrdersMap orders

Orders assigned to the worker

Link copied to clipboard
private final static String workerHandle

A primary identifier that uniquely identifies the worker outside of HyperTrack. Example: email, phone number, database id It is usually obtained and set when the worker logs into the app. Set it to an empty string "" when the worker logs out of the app to un-bind the device from the worker and avoid unintentional tracking.