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 Whether the facility is marked as verified (true) or blacklisted (false).
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 (milliseconds) required for the visit to count.
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?.verified == true }
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)")
}
}