Alan maskeleme gereklidir. Yanıtta hangi alanların döndürülmesini istediğinizi belirtmeniz gerekir. Döndürülen alanların varsayılan bir listesi yoktur. Bu listeyi atlarsanız yöntemler hata döndürür.
Yanıtta, yerle ilgili ayrıntıların yer aldığı bir GMSPlace örneği bulunur. GMSPlace örneğinin types özelliğindeki değerler artık A Tablosu ve B Tablosu ile tanımlanıyor.
Yanıt GMSPlace örneği, GMSPlaceReview türünde yeni bir reviews özelliği içeriyor.
Uygulamanız, GMSPlace
örneğinden alınan bilgileri (ör. fotoğraflar ve yorumlar) gösterdiğinde gerekli atıfları da göstermelidir.
Daha fazla bilgi için ilişkilendirmeler hakkındaki belgelere göz atın.
Yanıt GMSPlace örneği aşağıdaki üye işlevlerini içerir:
isOpen
Bir yerin belirtilen saatte açık olup olmadığını hesaplar.
isOpenAtDate
Bir yerin belirli bir tarihte açık olup olmadığını hesaplar.
Bu işlevler yalnızca iOS için Yerler SDK'sını etkinleştirdiğinizde kullanılabilir. iOS için Yerler SDK'sı (Yeni)'nı etkinleştirdiğinizde kullanılamazlar. Daha fazla bilgi için SDK sürümünüzü seçme başlıklı makaleyi inceleyin.
Örnek istek
Yer Ayrıntıları (Yeni) ile bir istekte bulunup GMSFetchPlaceRequest örneğindeki tüm parametreleri iletirsiniz. Bu örnekte, yanıtın yalnızca yerin görünen adını ve web sitesi URL'sini içermesi için alan maskesi de kullanılmaktadır:
Swift
// A hotel in Saigon with an attribution.letplaceID="ChIJV4k8_9UodTERU5KXbkYpSYs"// Specify the place data types to return.letfields=[GMSPlaceProperty.name,GMSPlaceProperty.website].map{$0.rawValue}// Create the GMSFetchPlaceRequest instance.letfetchPlaceRequest=GMSFetchPlaceRequest(placeID:placeID,placeProperties:fields,sessionToken:nil)client.fetchPlaceWithRequest(fetchPlaceRequest:fetchPlaceRequest,callback:{(place:GMSPlace?,error:Error?)inguardletplace,error==nilelse{return}print("Place found: \(String(describing:place.name))")})
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=[[GMSFetchPlaceRequestalloc]initWithPlaceID:placeIDplaceProperties:fieldssessionToken:nil];[placesClientfetchPlaceWithRequest:fetchPlaceRequestcallback:^(GMSPlace*_Nullableplace,NSError*_Nullableerror){if(error!=nil){NSLog(@"An error occurred %@",[errorlocalizedDescription]);return;}else{NSLog(@"Place Found: %@",place.name);NSLog(@"The place URL: %@",place.website);}}];
[null,null,["Son güncelleme tarihi: 2025-08-31 UTC."],[],[],null,["# Migrate to Place Details (New)\n\n\u003cbr /\u003e\n\n| This feature requires that you enable Places API (New), the next generation of the Places API. For more information, see [Enable APIs](/maps/documentation/places/ios-sdk/legacy/cloud-setup#enabling-apis).\n\n\u003cbr /\u003e\n\nPlaces SDK for iOS supports\n[Place Details (Legacy)](/maps/documentation/places/ios-sdk/place-details).\nIf you are familiar with Places SDK for iOS (Legacy),\n[Place Details (New)](/maps/documentation/places/ios-sdk/details-place)\nmakes the following changes:\n\n- Uses a new pricing model. For pricing information for all APIs, see\n [Pricing for the Places SDK for iOS (New)](/maps/documentation/places/ios-sdk/usage-and-billing#pricing-new).\n\n- Field masking is required. You must specify which fields you want returned\n in the response. There is no default list of returned fields. If you omit\n this list, the methods return an error.\n\n- To make a request, call the new\n [`GMSPlacesClient fetchPlaceWithRequest:`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlacesClient#-fetchplacewithrequest:callback:)\n method.\n\n- Pass to the request:\n\n - An instance of the new\n [`GMSFetchPlaceRequest`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSFetchPlaceRequest)\n class that defines all request parameters, such as the place ID and\n session token.\n\n - A callback of type\n [`GMSPlaceResultCallback`](/maps/documentation/places/ios-sdk/reference/objc/Type-Definitions#/c:GMSPlacesClient.h@T@GMSPlaceResultCallback)\n to handle the response.\n\n- The response contains a\n [`GMSPlace`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace)\n instance containing details about the place. The values in the `types`\n property of the `GMSPlace` instance are now defined by\n [Table A](/maps/documentation/places/ios-sdk/place-types#table-a) and\n [Table B](/maps/documentation/places/ios-sdk/place-types#table-b).\n\n- The response `GMSPlace` instance contains the new `reviews`\n property of type [`GMSPlaceReview`](/maps/documentation/places/ios-sdk/refereference/objc/Classes/GMSPlaceReview).\n When your app displays information obtained from the `GMSPlace`\n instance, such as photos and reviews, the app must also display the required\n attributions.\n\n For more information, see the documentation on\n [attributions](/maps/documentation/places/ios-sdk/policies#other_attribution_requirements).\n- The response `GMSPlace` instance contains the following member functions:\n\n - [`isOpen`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace#-isopen)\n calculates whether a place is open at the given time.\n\n - [`isOpenAtDate`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace#-isopenatdate:)\n calculates whether a place is open on a given date.\n\n These functions are only available when you enable\n **Places SDK for iOS** . They are not available when you\n enable **Places SDK for iOS (New)** . For more information,\n see [Choose your SDK version](/maps/documentation/places/ios-sdk/choose-sdk).\n\nExample request\n---------------\n\nWith Place Details (New), you make a request and\npass all parameters in the `GMSFetchPlaceRequest` instance. This\nexample also uses a field mask so the response only includes the display name\nand website URL for the place: \n\n### Swift\n\n```swift\n// A hotel in Saigon with an attribution.\nlet placeID = \"ChIJV4k8_9UodTERU5KXbkYpSYs\"\n\n// Specify the place data types to return.\nlet fields = [GMSPlaceProperty.name, GMSPlaceProperty.website].map {$0.rawValue}\n\n// Create the GMSFetchPlaceRequest instance.\nlet fetchPlaceRequest = GMSFetchPlaceRequest(placeID: placeID, placeProperties: fields, sessionToken: nil)\n\nclient.fetchPlaceWithRequest(fetchPlaceRequest: fetchPlaceRequest, callback: {\n (place: GMSPlace?, error: Error?) in\n guard let place, error == nil else { return }\n print(\"Place found: \\(String(describing: place.name))\")\n})\n```\n\n### Objective-C\n\n```objective-c\n// A hotel in Saigon with an attribution.\nNSString *placeID = @\"ChIJV4k8_9UodTERU5KXbkYpSYs\";\n\n// Specify the place data types to return.\nNSArray\u003cNSString *\u003e *fields = @[GMSPlacePropertyName, GMSPlacePropertyWebsite];\n\n// Create the GMSFetchPlaceRequest instance.\nGMSFetchPlaceRequest *fetchPlaceRequest = [[GMSFetchPlaceRequest alloc] initWithPlaceID:placeID placeProperties: fields sessionToken:nil];\n\n[placesClient fetchPlaceWithRequest: fetchPlaceRequest callback: ^(GMSPlace *_Nullable place, NSError *_Nullable error) {\n if (error != nil) {\n NSLog(@\"An error occurred %@\", [error localizedDescription]);\n return;\n } else {\n NSLog(@\"Place Found: %@\", place.name);\n NSLog(@\"The place URL: %@\", place.website);\n }\n}];\n```"]]