Releases: hypertrack/sdk-flutter
Releases · hypertrack/sdk-flutter
3.0.2
3.0.1
3.0.0
Changed
Order.isInsideGeofence
is now an async fuction that returns the value at the moment when it called (instead of the constant value at the time ofgetOrders
being called)- Updated HyperTrack SDK iOS to 5.11.0
- Updated HyperTrack SDK Android to 7.11.0
Fixed
- Wrong order of Orders in
HyperTrack.getOrders()
on iOS - Error on
HyperTrack.getOrders()
/HyperTrack.subscribeToOrders()
on Android when assigning multiple orders to the worker
2.7.0
Added
- New
HyperTrack.allowMockLocation
andHyperTrack.setAllowMockLocation()
methods which can be used to allow mocking location data.- Check the Test with mock locations guide for more information.
- Note: To avoid issues related to race conditions in your code use this API only if modifying the compiled
HyperTrackAllowMockLocation
AndroidManifest.xml/Info.plist value is insufficient for your needs.- Example: if for some reason you aren't able to recompile with
HyperTrackAllowMockLocation
set toYES
/true
for your prod app QA mock location tests and need to set up the value in runtime.
- Example: if for some reason you aren't able to recompile with
- Note: To avoid issues related to race conditions in your code use this API only if modifying the compiled
- Check the Test with mock locations guide for more information.
- Gradle 8 support
Changed
2.6.1
2.6.0
2.5.2
2.5.1
2.5.0
2.4.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: Verify shift presence before starting work
- To learn more about how to best use this new feature see our guide
// check worker presence synchronously
var activeOrders = await HyperTrack.orders;
Order? currentOrder = activeOrders["current_order"];
if (currentOrder != null) {
handlePresence(currentOrder.isInsideGeofence);
} else {
print("'current_order' not found");
}
// or subscribe to the changes in orders to get the status updates
HyperTrack.ordersSubscription.listen((orders) {
Order? currentOrder = orders["current_order"];
if (currentOrder != null) {
handlePresence(currentOrder.isInsideGeofence);
} else {
print("'current_order' not found");
}
});
// handle worker presence inside the order destination geofence
void handlePresence(Result<bool, LocationError> isInsideGeofence) {
switch (isInsideGeofence.runtimeType) {
case Success:
if ((isInsideGeofence as Success).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;
}
}