<br />

> [!NOTE]
> This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](https://developers.google.com/maps/documentation/places/ios-sdk/legacy/cloud-setup#enabling-apis).

<br />

Places API (Legacy) supports
[Place Details (Legacy)](https://developers.google.com/maps/documentation/places/ios-sdk/place-details).
If you are familiar with Places API (Legacy),
[Place Details (New)](https://developers.google.com/maps/documentation/places/ios-sdk/details-place.md.txt)
makes the following changes:

- Uses a new pricing model. For pricing information for all APIs, see
  [Usage and billing](https://developers.google.com/maps/documentation/places/ios-sdk/usage-and-billing.md.txt).

- Field masking is required. You must specify which fields you want returned
  in the response. There is no default list of returned fields. If you omit
  this list, the methods return an error.

- To make a request, call the new
  [`GMSPlacesClient fetchPlaceWithRequest:`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlacesClient.md.txt#-fetchplacewithrequest:callback:)
  method.

- Pass to the request:

  - An instance of the new
    [`GMSFetchPlaceRequest`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSFetchPlaceRequest.md.txt)
    class that defines all request parameters, such as the place ID and
    session token.

  - A callback of type
    [`GMSPlaceResultCallback`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Type-Definitions.md.txt#/c:GMSPlacesClient.h@T@GMSPlaceResultCallback)
    to handle the response.

- The response contains a
  [`GMSPlace`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace.md.txt)
  instance containing details about the place. The values in the `types`
  property of the `GMSPlace` instance are now defined by
  [Table A](https://developers.google.com/maps/documentation/places/ios-sdk/place-types.md.txt#table-a) and
  [Table B](https://developers.google.com/maps/documentation/places/ios-sdk/place-types.md.txt#table-b).

- The response `GMSPlace` instance contains the new `reviews`
  property of type [`GMSPlaceReview`](https://developers.google.com/maps/documentation/places/ios-sdk/refereference/objc/Classes/GMSPlaceReview).
  When your app displays information obtained from the `GMSPlace`
  instance, such as photos and reviews, the app must also display the required
  attributions.

  For more information, see the documentation on
  [attributions](https://developers.google.com/maps/documentation/places/ios-sdk/policies.md.txt#other_attribution_requirements).
- The response `GMSPlace` instance contains the following member functions:

  - [`isOpen`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace.md.txt#-isopen)
    calculates whether a place is open at the given time.

  - [`isOpenAtDate`](https://developers.google.com/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace.md.txt#-isopenatdate:)
    calculates whether a place is open on a given date.

  These functions are only available when you enable
  **Places SDK for iOS** . They are not available when you
  enable **Places SDK for iOS (New)** . For more information,
  see [Choose your SDK version](https://developers.google.com/maps/documentation/places/ios-sdk/choose-sdk).

## Example request

With Place Details (New), you make a request and
pass all parameters in the `GMSFetchPlaceRequest` instance. This
example also uses a field mask so the response only includes the display name
and website URL for the place:

### Swift

```swift
// A hotel in Saigon with an attribution.
let placeID = "ChIJV4k8_9UodTERU5KXbkYpSYs"

// Specify the place data types to return.
let fields = [GMSPlaceProperty.name, GMSPlaceProperty.website].map {$0.rawValue}

// Create the GMSFetchPlaceRequest instance.
let fetchPlaceRequest = GMSFetchPlaceRequest(placeID: placeID, placeProperties: fields, sessionToken: nil)

client.fetchPlaceWithRequest(fetchPlaceRequest: fetchPlaceRequest, callback: {
  (place: GMSPlace?, error: Error?) in
  guard let place, error == nil else { return }
  print("Place found: \(String(describing: place.name))")
})
```

### Objective-C

```objective-c
// A hotel in Saigon with an attribution.
NSString *placeID = @"ChIJV4k8_9UodTERU5KXbkYpSYs";

// Specify the place data types to return.
NSArray<NSString *> *fields = @[GMSPlacePropertyName, GMSPlacePropertyWebsite];

// Create the GMSFetchPlaceRequest instance.
GMSFetchPlaceRequest *fetchPlaceRequest = [[GMSFetchPlaceRequest alloc] initWithPlaceID:placeID placeProperties: fields sessionToken:nil];

[placesClient fetchPlaceWithRequest: fetchPlaceRequest callback: ^(GMSPlace *_Nullable place, NSError *_Nullable error) {
    if (error != nil) {
      NSLog(@"An error occurred %@", [error localizedDescription]);
      return;
    } else {
    NSLog(@"Place Found: %@", place.name);
    NSLog(@"The place URL: %@", place.website);
  }
}];
```