get Location Types
abstract suspend fun getLocationTypes(categoryId: Int? = null, categoryCode: String? = null, activeOnly: Boolean = true): List<LocationTypeDefinition>
Lists the place types a nomination can be filed under, each linked to its category.
Use it to fill the type picker once a category is chosen: the picked LocationTypeDefinition.id is the nomination's LocationNomination.locationTypeId. Like the categories, the types are runtime data.
Android (Kotlin)
lifecycleScope.launch {
try {
val types = AFCore.locations().getLocationTypes(categoryCode = FavoriteLocation.FITNESS_CATEGORY)
showTypePicker(types)
} catch (t: Throwable) {
showError(t)
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
let types = try await AFCore.shared.locations().getLocationTypes(
categoryId: KotlinInt(int: category.id), categoryCode: nil, activeOnly: true
)
showTypePicker(types)
} catch {
showError(error)
}
}Content copied to clipboard
Return
The list of LocationTypeDefinition.
Parameters
category Id
Optional filter by category id.
category Code
Optional filter by category code.
active Only
true (default) returns only active types.
Throws
if the list cannot be retrieved. Same empty-200 degradation caveat as getLocationCategories.