Jump to content

Geofencing

From Resco's Wiki
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.

Design considerations

As the security standards of mobile operating systems improve, mobile apps have a hard time to get universal access to the exact location of the device at all times. Solutions that worked few years ago are no longer reliable, particularly if the app is in the background.

Preview The geofencing feature described in this article is planned for release 17.1. It will be available for Android devices.

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 in 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 but geofencing produces records with new resco_operation values

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

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

  • resco_entityname with logical name of initiating entity
  • resco_entityid with id of initiating record.