GooglePlaces Framework Reference

Type-Definitions

The following type definitions are available globally.

  • The properties represent individual information that can be requested for a GMSPlace object. If no request properties are set, the GMSPlace object will be empty with no useful information.

    Note: GMSPlacePropertyPhoneNumber, GMSPlacePropertyWebsite and GMSPlacePropertyAddressComponents are not supported for GMSPlaceLikelihoodList place objects. Please refer to https://developers.google.com/places/ios-sdk/place-data-fields for more details.

    Declaration

    Swift

    struct GMSPlaceProperty : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked Sendable

    Objective-C

    typedef NSString *const GMSPlaceProperty
  • Completion type for receiving App Check tokens. If an error occurred, token will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSAppCheckTokenCompletion = (String?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSAppCheckTokenCompletion)(NSString *_Nullable,
                                               NSError *_Nullable)

    Parameters

    token

    The NSString that was returned.

    error

    The error that occurred, if any.

  • Callback type for receiving place details lookups. If an error occurred, result will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlaceResultCallback = (GMSPlace?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceResultCallback)(GMSPlace *_Nullable, NSError *_Nullable)

    Parameters

    result

    The GMSPlace that was returned.

    error

    The error that occurred, if any.

  • Callback type for receiving place likelihood lists. If an error occurred, likelihoodList will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlaceLikelihoodListCallback = (GMSPlaceLikelihoodList?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceLikelihoodListCallback)(
        GMSPlaceLikelihoodList *_Nullable, NSError *_Nullable)

    Parameters

    likelihoodList

    The list of place likelihoods.

    error

    The error that occurred, if any.

  • Callback type for receiving array of GMSPlaceLikelihoods. If an error occurred, the array will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlaceLikelihoodsCallback = ([GMSPlaceLikelihood]?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceLikelihoodsCallback)(
        NSArray<GMSPlaceLikelihood *> *_Nullable, NSError *_Nullable)
  • Callback type for receiving autocompletion results. results is an array of GMSAutocompletePredictions representing candidate completions of the query.

    Declaration

    Swift

    typealias GMSAutocompletePredictionsCallback = ([GMSAutocompletePrediction]?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSAutocompletePredictionsCallback)(
        NSArray<GMSAutocompletePrediction *> *_Nullable, NSError *_Nullable)

    Parameters

    results
    error

    The error that occurred, if any.

  • Callback type for receiving place photos results. If an error occurred, photos will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlacePhotoMetadataResultCallback = (GMSPlacePhotoMetadataList?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlacePhotoMetadataResultCallback)(
        GMSPlacePhotoMetadataList *_Nullable, NSError *_Nullable)

    Parameters

    photos

    The result containing GMSPlacePhotoMetadata objects.

    error

    The error that occurred, if any.

  • Callback type for receiving UIImage objects from a GMSPlacePhotoMetadata object. If an error occurred, photo will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlacePhotoImageResultCallback = (UIImage?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlacePhotoImageResultCallback)(UIImage *_Nullable,
                                                     NSError *_Nullable)

    Parameters

    photo

    The UIImage which was loaded.

    error

    The error that occurred, if any.

  • Callback type for receiving the opening hours status for the Place. If an error occurred, result will be GMSPlaceOpenStatusUnknown and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlaceOpenStatusCallback = (GMSPlaceOpenStatus, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceOpenStatusCallback)(GMSPlaceOpenStatus,
                                               NSError *_Nullable)

    Parameters

    result

    The GMSPlaceOpenStatus that was returned.

    error

    The error that occurred, if any.

  • Callback type for receiving the open status response. If an error occurred, response will be have a status of GMSPlaceOpenStatusUnknown and error will contain information about the error.

    Declaration

    Swift

    typealias GMSPlaceOpenStatusResponseCallback = (GMSPlaceIsOpenResponse, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceOpenStatusResponseCallback)(
        GMSPlaceIsOpenResponse *_Nonnull, NSError *_Nullable)

    Parameters

    response

    The GMSPlaceIsOpenResponse that was returned.

    error

    The error that occurred, if any.

  • Callback type for receiving search by text results. results is an array of GMSPlace representing individual results matching the query.

    Declaration

    Swift

    typealias GMSPlaceSearchByTextResultCallback = ([GMSPlace]?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceSearchByTextResultCallback)(
        NSArray<GMSPlace *> *_Nullable, NSError *_Nullable)

    Parameters

    results

    An array of GMSPlaces.

    error

    The error that occurred, if any.

  • Callback type for receiving a photo. photoImage is a UIImage representing the resulting photo matching the specified request. If an error occurred, photoImage will be nil and error will contain information about the error.

    Declaration

    Swift

    typealias GMSFetchPhotoResultCallback = (UIImage?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSFetchPhotoResultCallback)(UIImage *_Nullable,
                                                NSError *_Nullable)

    Parameters

    photoImage

    A UIImage result.

  • Callback type for autocomplete results.

    Declaration

    Swift

    typealias GMSAutocompleteSuggestionsCallback = ([GMSAutocompleteSuggestion]?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSAutocompleteSuggestionsCallback)(
        NSArray<GMSAutocompleteSuggestion *> *_Nullable, NSError *_Nullable)

    Parameters

    results
    error

    The error that occurred, if any.

  • Callback type for receiving search nearby results.

    Declaration

    Swift

    typealias GMSPlaceSearchNearbyResultCallback = ([GMSPlace]?, (any Error)?) -> Void

    Objective-C

    typedef void (^GMSPlaceSearchNearbyResultCallback)(
        NSArray<GMSPlace *> *_Nullable, NSError *_Nullable)

    Parameters

    places

    An array of GMSPlace

    error

    The error that occurred, if any.