Geofenced Clock-in/out
Enhance Workforce Efficiency with HyperTrack’s On-Device Geofencing and Geotags.
Overview
Managing workers’ actions in the field can be challenging, especially when ensuring that they are in the right place at the right time. HyperTrack’s on-device geofencing and geotag features simplify this process by providing real-time location verification. Geofencing ensures presence at order destination to make sure your workforce is exactly where they need to be when clocking in or out.
With this feature, you can:
- Ensure Compliance: Verify workers are on-site before they clock in (or clock out).
- Reduce Disputes: Minimize no-show disputes by making sure work starts on destination.
- Improve Payouts: More accurately capture worker lateness and overtime in case of disputes.
Add Clock-in/out tags to a shift timeline
For shift work, the clock-in/out actions by the worker determine when the shift starts and ends. Tracking the location and time of these actions is therefore important to confirm the shift started and ended at the expected location and time and establish proof of work.
HyperTrack makes it very easy for you to add clock-in/out tags to a shift timeline. You can do this by creating geotags associated with the relevant HyperTrack order_handle
which is the unique shift identifier like a unique shift_id
for instance.
To add clock-in/out tags to order timeline you have to call the addGeotag(order_handle, order_status, metadata)
SDK method from your worker app. The doc links are shared below:
Please see this code example on how to send the clock in tag for a shift at Gotham city hospital
:
val metadata = mutableMapOf<String, Any>()
metadata["facility"] = "Gotham city hospital"
val orderHandle = "!! use your unique shift id !!"
val orderStatus = OrderStatus.ClockIn
// see the dashboard order timeline to find the clock in event
HyperTrack.addGeotag(orderHandle, orderStatus, metadata);
// see the dashboard order timeline to find the clock in event
HyperTrack.addGeotag(
orderHandle: "!! use your unique shift id !!",
orderStatus: .clockIn,
metadata: ["facility" : "Gotham city hospital"]
);
let orderHandle = "!! use your unique shift id !!"
let orderStatus = { "type": "orderStatusClockIn" }
let metadata = { "facility" : "Gotham city hospital" }
// see the dashboard order timeline to find the clock in event
HyperTrack.addGeotag(orderHandle, orderStatus, metadata);
The clock-in/out geotags serve as an additional data point to the existing order timeline events (such as arrival
to, or an exit
from, an order's destination).
Clock-in/out geotags are created in your worker app through the HyperTrack SDK.
If your worker's device is temporarily disconnected due to a network loss, order geotags generated by your workers will be captured offline and sent to HyperTrack once connection is restored.
Timeline Annotations
Clock-in and Clock-out tags are annotated in the order timeline. Our Geotags feature can be used in conjunction with a Proof of Work order to add custom annotations or events to the order timeline by populating the order_handle
metadata field in the Geotag.
Verify shift presence before starting work
On-device geofencing allows you to automate the clock-in/out process based on precise geolocation data and current order destination. HyperTrack SDK supports on-device geofencing via isInsideGeofence
property on your orders.
Example use for worker clock in:
func handlePresence(
_ isInsideResult: Result<Bool, HyperTrackLocationError>
) {
switch isInsideResult {
case .success(let isInside):
if isInside {
// allow worker to clock in for the shift
} else {
// "to clock in you must be at order destination"
}
case .failure(let error):
// resolve any tracking errors to obtain geofence presence
}
// check if a worker is inside an order's geofence and using order handle
handlePresence(HyperTrack.orders["my_order"].isInsideGeofence)
// or, listen to order.isInsideGeofence changes
HyperTrack.subscribeToOrders { orders in
handlePresence(orders["my_order"].isInsideGeofence)
}
import HyperTrack
fun handlePresence(isInsideResult: Result<Boolean, HyperTrackLocationError>) {
when (isInsideResult) {
is Result.Success -> {
val isInside = isInsideResult.getOrNull() ?: false
if (isInside) {
// allow worker to clock in for the shift
} else {
// "to clock in you must be at order destination"
}
}
is Result.Failure -> {
// resolve any tracking errors to obtain geofence presence
}
}
}
// Check if a worker is inside an order's geofence
handlePresence(HyperTrack.orders["my_order"]?.isInsideGeofence)
// Or, listen to order.isInsideGeofence changes
HyperTrack.subscribeToOrders { orders ->
handlePresence(orders["my_order"]?.isInsideGeofence)
}
import HyperTrack, { LocationError, Order, Result } from 'hypertrack-sdk-react-native';
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"
}
case 'failure':
// resolve any tracking errors to obtain geofence presence
}
// check if a worker is inside an order's geofence
let orders = await HyperTrack.getOrders();
handlePresence(orders.get("my_order").isInsideGeofence)
// or, listen to order.isInsideGeofence changes
HyperTrack.subscribeToOrders((orders: Map<string, Order>) => {
handlePresence(orders.get("my_order").isInsideGeofence)
})
This feature requires Orders API integration
To use this feature, make sure you're tracking work with the Orders API.
Value
HyperTrack.orders
contains any active orders for the worker. TheisInsideGeofence
status is calculated based on theorder.destination
geometry, which is provided when creating the order with the Orders API.Local geofencing works offline once any active orders have been received.
Updated 2 months ago