Skip to content

Commit

Permalink
Update changelog (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kuznetsov-hypertrack authored Aug 21, 2024
1 parent 89d15f9 commit cb316e1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Support for on-device geofencing via new `HyperTrack.orders["my_order"].isInsideGeofence` property
- To learn more about how to best use this new feature see our guide here: https://developer.hypertrack.com/docs/clock-in-out-tagging#verify-shift-presence-before-starting-work

Example use for worker clock in:

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

// check if a worker is inside an order's geofence
handlePresence(HyperTrack.orders.get("my_order").isInsideGeofence)

// or, listen to order.isInsideGeofence changes
HyperTrack.subscribeToOrders((orders) => {
handlePresence(orders.get("my_order").isInsideGeofence)
})
```

### Added

- Support for on-device geofencing via new `HyperTrack.orders["my_order"].isInsideGeofence` property
- To learn more about how to best use this new feature see our guide here: https://developer.hypertrack.com/docs/clock-in-out-tagging#verify-shift-presence-before-starting-work

Expand Down

0 comments on commit cb316e1

Please sign in to comment.