awaitSearchNearbyPlace

@ExperimentalCoroutinesApi
@RequiresPermission(anyOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"])
suspend fun PlacesClient.awaitSearchNearbyPlace(locationRestriction: LocationRestriction, placeFields: List<Place.Field>): SearchNearbyResponse

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