Geofencing

From Resco's Wiki
Jump to navigation Jump to search
Location-based services
Warning Work in progress! We are in the process of updating the information on this page. Subject to change.
Wikipedia logo
Wikipedia has an article on a similar subject:

Geofencing is a location-based service in which a software application uses GPS to trigger a pre-programmed action when a mobile enters or exits a virtual boundary set up around a geographical location, known as a geofence.

Preview The geofencing feature of Resco mobile apps (Android, iOS) introduced in release 17.1 allows you to get immediate updates when your front-line workers enter or leave one of your predefined locations (such as office, service location, etc.). This works reliably on a wide range of devices with minimal battery impact and improved user privacy (only presence at pre-set locations is monitored, not the overall location)​.
  1. Configure the tables you want to geofence in Woodford​.
  2. When mobile users enter the specified location, a mobile audit event is generated. This works even if the app is in the background, the screen is off, etc.
  3. Capture mobile audit event on your backend to trigger additional logic (e.g., using Power Automate to update work order status)​.

Prerequisites

Woodford configuration

  1. Start Woodford and select Location-based services from the Administration menu.
  2. Register one dedicated user for your organization. It is required for our real-time flushing service which forwards resco_mobileaudit records to your CRM under this user.
  3. Edit an app project and select Geofencing from the Project menu.
  4. Enable geofencing and set it up as needed (see below)
  5. Save all changes and publish the app project.

For testing, we recommend following these steps:

  • Set Log verbosity to "Diagnostic".
  • Allow all business days and hours (00:00 – 23:59).
  • Don't use geofence radius smaller than 100m.
  • Make sure to choose the right latitude/longitude fields.
  • Use a defensive filter (not to exclude some records). Keep in mind that this filter is combined with sync filter (even in online mode). The Android operating system limits the number of geofenced records to 100.

Usage in the app

After syncing Resco Mobile CRM app with an app project that has an active geofencing configuration, the app will require several additional permissions

  • Notifications
  • Location > Allow all the time
  • Background location
  • Battery > Unrestricted

The Send Log action in About dialog includes new "realtime.log". If diagnostic log is enabled, it contains details about all geofencing events including each Enter/Exit event with anonymous ID of record which is related to the geofence.

Known issues

  • Some Android vendors have their own layer of security blocking the background startup/autostart. User must explicitly allow it for Resco Mobile CRM app. This applies to Xiaomi, Vivo, Oppo, Huawei, and maybe also others.
  • Results are much more reliable if device has an active mobile connection.

Consuming geofence events

The mobile audit data generated from the app can be further processed on the server, for example, using Power Automate/Power Platform workflows. There's a small difference between location tracking and geofencing that must be adjusted in server-side processing. Both services produce the same resco_mobileaudit entity records. However, geofencing produces records with different resco_operation values:

  • GeoFenceEnter (value 473220012)
  • GeoFenceExit (value 473220013)
instead of original GpsChanged (473220011)

In addition to that, geofencing audit records contain references to originating bookable resource booking/appointment table row (or other tables) that are associated with the triggered geofencing event. A mobile audit record has these reference fields:

  • resco_entityname with the logical name of the initiating table (entity)
  • resco_entityid with the id of the initiating table row (record).