removeGeofences static method
Remove all monitored Geofence records, or a specific subset by identifier.
With no argument, removes every geofence. With a list of identifiers, removes only the geofences it names. An empty list removes none.
Example
// Remove all geofences.
BackgroundGeolocation.removeGeofences();
// Remove only these.
BackgroundGeolocation.removeGeofences(['HOME', 'WORK']);
Implementation
static Future<bool> removeGeofences([List<String>? identifiers]) async {
// (WO-055) An empty list names none. It never crosses to native, where both cores read an
// empty list as "remove all".
if (identifiers != null && identifiers.isEmpty) return true;
// (WO-053) null (omitted) means all; the natives answer an error for anything but a list.
return (await _methodChannel.invokeMethod<bool>(
'removeGeofences', identifiers)) as FutureOr<bool>;
}