awaitSearchNearby

@ExperimentalCoroutinesApi
@RequiresPermission(anyOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"])
suspend fun PlacesClient.awaitSearchNearby(locationRestriction: LocationRestriction, placeFields: List<Place.Field>, actions: SearchNearbyRequest.Builder.() -> Unit = {}): SearchNearbyResponse

Deprecated

Use the version in the Places SDK instead.

Replace with

this.awaitSearchNearby(locationRestriction, placeFields, actions)

Wraps PlacesClient.searchNearby in a suspending function.

Fetches the approximate nearby places based on the provided locationRestriction. Calling this method without granting the appropriate permissions will result in a SecurityException being thrown. In addition, if an error occurred while fetching the places, an ApiException will be thrown.

Return

the response containing the nearby place results.

Parameters

locationRestriction

limits the scope of the search to a specific area.

placeFields

the fields of the places to be returned

actions

the actions to apply to the SearchNearbyRequest.Builder