GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSFetchPhotoRequest
@interface GMSFetchPhotoRequest : NSObject
Request object to use with GMSPlacesClient
to fetch a photo.
-
Declaration
Objective-C
- (nonnull instancetype)initWithPhotoMetadata:
(nonnull GMSPlacePhotoMetadata *)photoMetadata
maxSize:(CGSize)maxSize;
Parameters
photoMetadata
|
GMSPlacePhotoMetadata The maximum desired size in pixels
of the image returned by the Place Photos service.
|
maxSize
|
CGSize The photo metadata to request.
If the image is smaller than the values specified, the original image will be returned. If the
image is larger in either dimension, it will be scaled to match the smaller of the two
dimensions, restricted to its original aspect ratio. CGSize height and width should be set to an
integer between 1 and 4800. If not, the GMSPlacesClient request callback will return an error.
|
-
Default init is not available. Please use the designated initializer.
Declaration
Objective-C
- (nonnull instancetype)init;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSFetchPhotoRequest\u003c/code\u003e objects are used with \u003ccode\u003eGMSPlacesClient\u003c/code\u003e to retrieve photos for places.\u003c/p\u003e\n"],["\u003cp\u003eThe designated initializer, \u003ccode\u003einitWithPhotoMetadata:maxSize:\u003c/code\u003e, allows specifying the photo metadata and the desired maximum size for the image.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ephotoMetadata\u003c/code\u003e parameter provides details about the photo being requested.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emaxSize\u003c/code\u003e parameter determines the maximum dimensions of the returned image, ensuring it's scaled appropriately while preserving its aspect ratio.\u003c/p\u003e\n"],["\u003cp\u003eThe default initializer, \u003ccode\u003einit\u003c/code\u003e, is unavailable; use the designated initializer instead.\u003c/p\u003e\n"]]],[],null,["# GooglePlaces Framework Reference\n\nGMSFetchPhotoRequest\n====================\n\n @interface GMSFetchPhotoRequest : NSObject\n\nRequest object to use with [GMSPlacesClient](../Classes/GMSPlacesClient.html) to fetch a photo.\n- `\n ``\n ``\n `\n\n ### [-initWithPhotoMetadata:maxSize:](#/c:objc(cs)GMSFetchPhotoRequest(im)initWithPhotoMetadata:maxSize:)\n\n `\n ` \n Request object to use with [GMSPlacesClient](../Classes/GMSPlacesClient.html) to fetch a photo. \n\n #### Declaration\n\n Swift \n\n init(photoMetadata: ../Classes/GMSPlacePhotoMetadata.html, maxSize: CGSize)\n\n Objective-C \n\n - (nonnull instancetype)initWithPhotoMetadata:\n (nonnull ../Classes/GMSPlacePhotoMetadata.html *)photoMetadata\n maxSize:(CGSize)maxSize;\n\n #### Parameters\n\n |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*photoMetadata*` ` | [GMSPlacePhotoMetadata](../Classes/GMSPlacePhotoMetadata.html) The maximum desired size in pixels of the image returned by the Place Photos service. |\n | ` `*maxSize*` ` | `CGSize` The photo metadata to request. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. CGSize height and width should be set to an integer between 1 and 4800. If not, the [GMSPlacesClient](../Classes/GMSPlacesClient.html) request callback will return an error. |\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMSFetchPhotoRequest(im)init)\n\n `\n ` \n Unavailable \n Default init is not available. Please use the designated initializer. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;"]]