Skip to content

13.5.0

Compare
Choose a tag to compare
@pavel-kuznetsov-hypertrack pavel-kuznetsov-hypertrack released this 02 Sep 14:07
· 8 commits to master since this release
f0bd800

Added

  • Support for on-device geofencing via new HyperTrack.orders.get("my_order_handle").isInsideGeofence property

Example use for worker clock in:

// check worker presence synchronously
let activeOrders = await HyperTrack.getOrders()
let currentOrder = activeOrders.get("current_order")
if (currentOrder !== undefined) { handlePresence(currentOrder) }
else { console.log("'current_order' not found") }

// or subscribe to the changes in orders to get the status updates
HyperTrack.subscribeToOrders(orders => {
  let let currentOrder = activeOrders.get("current_order")
  if (currentOrder !== undefined) { handlePresence(currentOrder) }
  else { console.log("'current_order' not found") }
})

// handle worker presence inside the order destination geofence
function handlePresence(isInsideGeofence: Result<boolean, LocationError>) {
  switch (isInsideGeofence.type) {
    case 'success':
      if (isInsideGeofence.value) {
        // allow worker to clock in for the shift
      } else {
        // "to clock in you must be at order destination"
      }
      break;
    case 'failure':
      // resolve errors to check for presence
      break;
  }
}

Changed

  • Updated HyperTrack SDK iOS to 5.7.0
  • Updated HyperTrack SDK Android to 7.7.0