Facility
Facility — represents a physical or virtual location in the Advanta network.
Facilities are the core places where members complete activities (e.g., gyms, clubs, offices). They may be verified by Advanta and can optionally include Beacons for indoor/proximity detection.
Properties
id Unique identifier of the facility.
isPrimary Whether this facility is set as the member’s primary installation.
verified
trueonly when status is FacilityStatus.VERIFIED. Convenience alias preserved for source compatibility.status Verification state — see FacilityStatus. The SDK only registers geofences for FacilityStatus.VERIFIED facilities; FacilityStatus.BLACKLISTED and FacilityStatus.UNKNOWN entries are silently skipped while VERIFIED ones in the same list still register normally.
name Display name of the facility.
address Physical address of the facility.
city City of the facility.
state State of the facility.
type Type of facility (defaults to LocationType.CUSTOM).
latitude, longitude Geographic coordinates for the facility.
radius Geofence radius in meters.
dwell Minimum dwell time in seconds required for the visit to count. May be
nullif the facility relies on the application-wide default. When the SDK builds geofences from facilities the effective dwell ismax(applicationSettings.geofenceDwellTimeSeconds, facility.dwell)— the server can lengthen dwell per facility but cannot shorten it below the general minimum.beacons Optional list of Beacons for indoor detection.
Notes
A facility can be primary, but members may have multiple verified facilities.
Use
radiusanddwellfor geofencing logic.If beacons are present, use them for higher precision indoors (instead of GPS).
Android (Kotlin) — show verified facilities
lifecycleScope.launch {
try {
val facilities = AFCore.facilities().get()
val verified = facilities.filter { it.status == FacilityStatus.VERIFIED }
verified.forEach { fac -> println("Verified: ${fac.name} at ${fac.address}") }
} catch (t: Throwable) {
showError("Failed to load facilities: ${t.message}")
}
}iOS (Swift) — print primary facility
Task {
do {
let facilities = try await AFCore.shared.facilities().get()
if let primary = facilities.first(where: { $0?.isPrimary == true }) {
print("Primary facility: \\(primary?.name ?? "-")")
}
} catch {
print("Failed to fetch facilities: \\(error.localizedDescription)")
}
}Constructors
Properties
Legacy boolean view of status. Reads true only when status is FacilityStatus.VERIFIED. Writing true sets status to VERIFIED; writing false sets it to BLACKLISTED. To represent the third state, set status to FacilityStatus.UNKNOWN directly.