getMonitoredGeofences

Get all IDs of monitored geofences.

Syntax 

1import { getGeofencingService } from 'lightning/mobileCapabilities';
2getMonitoredGeofences: Promise<[string]>;

Parameters 

None.

Returns 

A Promise object that resolves as an array of string values. The values are unique IDs assigned to monitored geofences. If there’s an error, a rejected promise returns the error type of GeofenceServiceFailure.

Usage 

This function calls all the IDs of monitored geofences.

1myGeofenceService
2  .getMonitoredGeofences()
3  .then((results) => {
4    const activeGeofences = JSON.parse(JSON.stringify(results, undefined, 2));
5    const msg = `Number of geofences: ${activeGeofences.length}`;
6    console.log(msg);
7  })
8  .catch((error) => {
9    const msg = `Failed to get current geofences:${JSON.stringify(error)}`;
10    console.log(msg);
11  });

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.