PlacesClient
final class PlacesClientextension PlacesClient : PlacesClientProtocol, SendableMain interface to the Places SDK, used for searching and getting details about places.
This type should be accessed through PlacesClient.shared.
PlacesClient methods should only be called from the main thread. Calling these methods from
another thread will result in an exception or undefined behavior.
- 
                  
                  Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of a marker clustering library. To opt out of sending the usage attribution ID, it is safe to delete this function call or replace the value with an empty string. DeclarationSwift @MainActor static func addInternalUsageAttributionID(_ internalUsageAttributionID: String)
- 
                  
                  DeclarationSwift final func fetchAutocompleteSuggestions(with request: AutocompleteRequest) async -> Result<[AutocompleteSuggestion], PlacesError>
- 
                  
                  Get a place using a request object. DeclarationSwift final func fetchPhoto(with request: FetchPhotoRequest) async -> Result<UIImage, PlacesError>ParameterswithThe FetchPhotoRequestto use for the query.Return ValueA Resultwith theUIImageresponse for the request, or aPlacesError.
- 
                  
                  Get a place using a request object. DeclarationSwift final func fetchPlace(with request: FetchPlaceRequest) async -> Result<Place, PlacesError>ParameterswithFetchPlaceRequestThe fetch place request to use for the query.Return ValueA Resultwith thePlaceresponse for the request, or aPlacesError.
- 
                  
                  Gets the open status for a place. Gets details for a place including all properties necessary to determine if it is open at the optionally specified Date.DeclarationSwift final func isPlaceOpen(with request: IsPlaceOpenRequest) async -> Result<IsPlaceOpenResponse, PlacesError>Return ValueA PlaceIsOpenResponsewith theBool?status for the requested place, or aPlacesError.
- 
                  
                  Returns the open source software license information for the Google Places SDK for iOS. This information must be made available within your application. DeclarationSwift static var openSourceLicenseInfo: String { get }
- 
                  
                  Provides your API key to the Google Places SDK for iOS. This key is generated for your application via the Google Cloud Platform Console, and is paired with your application’s bundle ID to identify it. This should be called by your application before using PlacesClient (e.g., in application:didFinishLaunchingWithOptions:). DeclarationSwift @MainActor static func provideAPIKey(_ key: String) -> BoolReturn Valuetrue if the APIKey was successfully provided. 
- 
                  
                  Returns the long version for this release of the Google Places SDK for iOS. For example, “1.0.0 (102.1)”. DeclarationSwift static var sdkLongVersion: String { get }
- 
                  
                  Returns the version for this release of the Google Places SDK for iOS. For example, “1.0.0”. DeclarationSwift static var sdkVersion: String { get }
- 
                  
                  Search for places by text and restrictions. DeclarationSwift final func searchByText(with request: SearchByTextRequest) async -> Result<[Place], PlacesError>ParameterswithSearchByTextRequestThe text request to use for the query.Return ValueA Resultwith the[Place]response for the request, or aPlacesError.
- 
                  
                  Search for places near a location and restriction. DeclarationSwift final func searchNearby(with request: SearchNearbyRequest) async -> Result<[Place], PlacesError>ParameterswithSearchNearbyRequestThe search nearby request to use for the query.Return ValueA Resultwith the[Place]response for the request, or aPlacesError.
- 
                  
                  Provides the App Check token provider to the Google Places SDK for iOS. This token provider is used to fetch the App Check token. This should be called by your application before using PlacesClient (for example, in application:didFinishLaunchingWithOptions:). DeclarationSwift @MainActor static func setAppCheckTokenProvider(_ tokenProvider: any AppCheckTokenProvider)ParameterstokenProviderThe App Check token provider. 
- 
                  
                  Provides the shared instance of PlacesClient for the Google Places SDK for iOS, creating it if necessary. If your application often uses methods of PlacesClient it may want to retain this object directly, as otherwise your connection to Google may be restarted on a regular basis. Note Google Places SDK for iOS must be initialized via PlacesClient.provideAPIKey(…) prior to use.DeclarationSwift @MainActor unowned static var shared: PlacesClient { get }