start Monitoring
Starts monitoring presence events for the member’s facilities.
Geofences are registered for all verified facilities. The dwell threshold (how long the member must remain inside a facility region for a visit to be recorded) is determined by the application settings, which the SDK syncs automatically during initialization.
Call stopMonitoring when monitoring is no longer required to release resources.
Throws
if monitoring cannot be started.
Android (Kotlin)
lifecycleScope.launch {
try {
AFCore.facilities().startMonitoring()
} catch (t: Throwable) {
showError("Unable to start monitoring: ${t.message}")
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
try await AFCore.shared.facilities().startMonitoring()
} catch {
self.showError("Unable to start monitoring: \\(error.localizedDescription)")
}
}Content copied to clipboard