stop Monitoring
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}")
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
try await AFCore.shared.facilities().stopMonitoring()
} catch {
self.showError("Unable to stop monitoring: \\(error.localizedDescription)")
}
}Content copied to clipboard