Facility

class Facility(var id: Int = 0, var isPrimary: Boolean = false, var verified: Boolean = false, var name: String? = null, var address: String? = null, var city: String? = null, var state: String? = null, var type: LocationType? = null, var latitude: Double? = null, var longitude: Double? = null, var radius: Double? = null, var dwell: Int? = null, var beacons: List<Beacon?>? = emptyList())

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 radius and dwell for 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)")
}
}

Constructors

Link copied to clipboard
constructor(id: Int = 0, isPrimary: Boolean = false, verified: Boolean = false, name: String? = null, address: String? = null, city: String? = null, state: String? = null, type: LocationType? = null, latitude: Double? = null, longitude: Double? = null, radius: Double? = null, dwell: Int? = null, beacons: List<Beacon?>? = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var city: String?
Link copied to clipboard
var dwell: Int?
Link copied to clipboard
var id: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var name: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String