subscribeToStatus

abstract fun subscribeToStatus(onStatus: (AFGeofencingStatus) -> Unit, onError: (Throwable) -> Unit = {}): FlowSubscription

Subscribes to live geofencing-status changes. Replays the latest value to the new collector and emits whenever the SDK transitions states (e.g., from PAUSED to ACTIVE once the user grants Always location, or to PERMISSIONS_DENIED if the permission is revoked in Settings).

Use this to drive reactive UI without polling isMonitoringActive. Call FlowSubscription.close to stop.

Parameters

onStatus

Callback invoked for each new AFGeofencingStatus.

onError

Callback invoked if the status collection fails.