Skip to content

Commit

Permalink
Add Orders API (#110)
Browse files Browse the repository at this point in the history
Co-authored-by: ferologics <[email protected]>
  • Loading branch information
pavel-kuznetsov-hypertrack and ferologics authored Aug 29, 2024
1 parent 5111c2d commit e608684
Show file tree
Hide file tree
Showing 48 changed files with 412 additions and 105 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [13.5.0] - 2024-08-21

### 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: [Verify shift presence before starting work](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);
});
```

### Changed

- Updated HyperTrack SDK iOS to [5.7.0](https://github.com/hypertrack/sdk-ios/releases/tag/5.7.0)
- Updated HyperTrack SDK Android to [7.7.0](https://github.com/hypertrack/sdk-android/releases/tag/7.7.0)

## [13.4.0] - 2024-06-13

### Added
Expand Down Expand Up @@ -869,3 +907,4 @@ Initial release.
[13.3.4]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.3.4
[13.3.5]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.3.5
[13.4.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.4.0
[13.5.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.5.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![GitHub](https://img.shields.io/github/license/hypertrack/sdk-react-native?color=orange)](./LICENSE)
[![npm](https://img.shields.io/npm/v/hypertrack-sdk-react-native.svg)](https://www.npmjs.com/package/hypertrack-sdk-react-native)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.6.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.6.0-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.7.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.7.0-brightgreen.svg)](https://github.com/hypertrack/sdk-android)

[HyperTrack](https://www.hypertrack.com) lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e608684

Please sign in to comment.