Skip to content

Commit e608684

Browse files
Add Orders API (#110)
Co-authored-by: ferologics <[email protected]>
1 parent 5111c2d commit e608684

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+412
-105
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
## [Unreleased]
77

8+
## [13.5.0] - 2024-08-21
9+
10+
### Added
11+
12+
- Support for on-device geofencing via new `HyperTrack.orders["my_order"].isInsideGeofence` property
13+
- 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)
14+
15+
Example use for worker clock in:
16+
17+
```typescript
18+
function handlePresence(isInsideResult: Result<boolean, LocationError>) {
19+
switch (isInsideResult.type) {
20+
case "success":
21+
if (isInsideResult.value) {
22+
// allow worker to clock in for the shift
23+
} else {
24+
// "to clock in you must be at order destination"
25+
}
26+
break;
27+
case "failure":
28+
// resolve any tracking errors to obtain geofence presence
29+
}
30+
}
31+
32+
// check if a worker is inside an order's geofence
33+
handlePresence(HyperTrack.orders.get("my_order").isInsideGeofence);
34+
35+
// or, listen to order.isInsideGeofence changes
36+
HyperTrack.subscribeToOrders((orders) => {
37+
handlePresence(orders.get("my_order").isInsideGeofence);
38+
});
39+
```
40+
41+
### Changed
42+
43+
- Updated HyperTrack SDK iOS to [5.7.0](https://github.com/hypertrack/sdk-ios/releases/tag/5.7.0)
44+
- Updated HyperTrack SDK Android to [7.7.0](https://github.com/hypertrack/sdk-android/releases/tag/7.7.0)
45+
846
## [13.4.0] - 2024-06-13
947

1048
### Added
@@ -869,3 +907,4 @@ Initial release.
869907
[13.3.4]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.3.4
870908
[13.3.5]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.3.5
871909
[13.4.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.4.0
910+
[13.5.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.5.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

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

88
[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.
99

docs/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)