Develop Secure Code
GeofencingService Data Types
getGeofencingService()
isAvailable()
startMonitoringGeofence()
stopMonitoringGeofence()
stopMonitoringAllGeofences()
getMonitoredGeofences
Determine whether GeofencingService functionality is available.
1import { getGeofencingService } from 'lightning/mobileCapabilities';
2isAvailable(): BooleanNone.
Returns true when used on a supported device and false otherwise.
Use this function to disable or hide geofencing-based features on platforms where geofencing isn’t supported. For example:
1handleAddGeofenceClick() {
2 const myGeofencingService = getGeofencingService();
3 if (myGeofencingService.isAvailable()) {
4 // Perform geofencing service requests
5 }
6 else {
7 // GeofencingService isn’t available or consuming app hasn’t implemented it.
8 // Handle with message, error, beep, and so on
9 }
10}