get

abstract suspend fun get(): List<Facility>

Retrieves the list of facilities associated with the current member.

The list is cached locally; subsequent calls return the saved list unless synchronization with the server is explicitly triggered by the implementation.

Return

A list of Facility items for the logged-in member.

Throws

if the facilities cannot be retrieved.

Android (Kotlin)

lifecycleScope.launch {
try {
val facilities = AFCore.facilities().get()
facilitiesRecycler.submitList(facilities.filterNotNull())
} catch (t: Throwable) {
showError("Could not load facilities: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let facilities = try await AFCore.shared.facilities().get()
self.updateUI(with: facilities.compactMap { $0 })
} catch {
self.showError("Could not load facilities: \\(error.localizedDescription)")
}
}