nominate Location
Nominates a new place on behalf of the member.
Use it when the member cannot find a place - it replaces facilities().nominateFacility(...) and also takes a category, a type and a Google place id. Take LocationNomination.locationTypeId from getLocationTypes; when the member picked a searchPlaces result, pass its placeId as LocationNomination.googlePlaceId (with its coordinates) so the nomination is stored against the real place. The nomination then appears in getMySubmissions while it is reviewed.
Android (Kotlin)
lifecycleScope.launch {
try {
val nomination = LocationNomination(
locationTypeId = gymType.id, // from getLocationTypes()
name = "Downtown Fitness",
addressLine1 = "123 Main St",
city = "Springfield",
stateProvince = "IL",
postalCode = "62701",
googlePlaceId = place.placeId, // from searchPlaces()
latitude = place.latitude,
longitude = place.longitude,
currentlyAMember = true
)
val result = AFCore.locations().nominateLocation(nomination)
showSubmitted(result)
} catch (t: Throwable) {
showError(t)
}
}iOS (Swift)
Task {
do {
let nomination = LocationNomination(
locationTypeId: gymType.id,
name: "Downtown Fitness",
addressLine1: "123 Main St",
city: "Springfield",
stateProvince: "IL",
postalCode: "62701",
clientId: nil,
locationCategoryId: nil,
managerName: nil,
description: nil,
addressLine2: nil,
countryCode: nil,
latitude: place.latitude,
longitude: place.longitude,
googlePlaceId: place.placeId,
phone: nil,
phoneExtension: nil,
fax: nil,
email: nil,
websiteUrl: nil,
contactName: nil,
currentlyAMember: true
)
let result = try await AFCore.shared.locations().nominateLocation(nomination: nomination)
showSubmitted(result)
} catch {
showError(error)
}
}Return
The created LocationNominationResult (HTTP 201).
Parameters
The nomination; see LocationNomination for the required fields and their server-enforced limits.
Throws
if the nomination is rejected - a duplicate place answers 409, validation problems 400, both surfacing as AFException with the server's detail.