stopMonitoring

abstract suspend fun stopMonitoring(): Boolean

Stops monitoring facilities.

Call this when presence detection or facility monitoring is no longer needed to avoid unnecessary resource usage.

Throws

if monitoring cannot be stopped cleanly.

Android (Kotlin)

lifecycleScope.launch {
try {
AFCore.facilities().stopMonitoring()
} catch (t: Throwable) {
showError("Unable to stop monitoring: ${t.message}")
}
}

iOS (Swift)

Task {
do {
try await AFCore.shared.facilities().stopMonitoring()
} catch {
self.showError("Unable to stop monitoring: \\(error.localizedDescription)")
}
}