location Sharing
The most recent location-sharing attempt - sent, suppressed (and why), or failed - or null before the first one in this process. The SDK shares on initialization, on every foreground, alongside each visit-detection geofence transition, and in the background whenever the device moves significantly (AFHeartbeatTrigger.SIGNIFICANT_LOCATION_CHANGE). The background trigger runs only when the opt-in came from AFCoreConfig.Builder.locationSharingEnabled(true); an opt-in made with the deprecated heartbeat switches keeps the 1.11 triggers and never shares in the background.
Use it for a status or debug row ("last shared 2 min ago", "suppressed: no permission") - it replaces AFCore.heartbeat. From Swift, use subscribeToLocationSharing.
Android (Kotlin)
lifecycleScope.launch {
AFCore.locations().locationSharing
.filterNotNull()
.collect { status -> renderSharing(status.outcome, status.trigger) }
}Content copied to clipboard
iOS (Swift)
let last = AFCore.shared.locations().locationSharing.value as? AFHeartbeatStatusContent copied to clipboard