GeofencingService Example
Here’s a basic example of a Lightning web component that uses GeofencingService to monitor when a user arrives at or departs from a geographic region.
Here’s a basic example of a Lightning web component that uses GeofencingService to monitor and determine when a user arrives or departs a geographic region.
The component’s JavaScript file imports getGeofencingService() and uses it to get a GeofencingService instance. When the component is initialized, it tests whether GeofencingService is available and disables the buttons if it isn’t. Each button’s handler calls the corresponding GeofencingService function and displays the outcome in the template. This example monitors an entry geofence and an exit geofence at the Salesforce Tower.
See Also