remove Favorite
Removes a location from the member's favorites.
Use it for a "Remove from favorites" action - it replaces facilities().delete(id), and the legacy club id (Facility.id) is accepted in place of the canonical location id. A running visit-detection session drops the location's geofence. A muted favorite loses its mute too, so it leaves the list. To keep the location but pause its notifications and visits, use muteFavorite.
Android (Kotlin)
lifecycleScope.launch {
try {
AFCore.locations().removeFavorite(locationId = favorite.locationId)
refreshFavorites()
} catch (t: Throwable) {
showError(t)
}
}Content copied to clipboard
iOS (Swift)
Task {
do {
_ = try await AFCore.shared.locations().removeFavorite(locationId: favorite.locationId)
refreshFavorites()
} catch {
showError(error)
}
}Content copied to clipboard
Return
AFResult with status = true - the server answers 204 with no body, so there is no list to return.
Parameters
location Id
Canonical location id (a legacy club id is resolved server-side; 409 when ambiguous).
Throws
if the request fails - 404 when the location is neither a favorite nor muted.