location Sharing Enabled
Whether location sharing is on for this install - the opt-in declared with AFCoreConfig.Builder.locationSharingEnabled. Off by default: a host must collect the member's consent to share a live location separately from location permission.
Use it to render the opt-in's current state - it replaces AFCore.heartbeatEnabled. It is read-only: opt in with AFCoreConfig.Builder.locationSharingEnabled(true) (the replacement of AFCore.setHeartbeatEnabled() and AFCoreConfig.Builder.heartbeatEnabled()), and change it later by passing a new config to AFCore.reconfigure. From Swift, observe it with subscribeToLocationSharingEnabled.
Android (Kotlin)
val config = AFCoreConfig.builder()
.baseUrl(baseUrl)
.locationSharingEnabled(memberConsentedToShareLocation)
.build()
AFCore.initialize(config)
sharingSwitch.isChecked = AFCore.locations().locationSharingEnabled.valueContent copied to clipboard
iOS (Swift)
let isSharing = AFCore.shared.locations().locationSharingEnabled.value as? Bool ?? falseContent copied to clipboard