You're all set!

To start developing, please head over to our developer documentation.

Activate the Google Places API for iOS

To get you started we'll guide you through the Google Developers Console to do a few things first:

  1. Create or choose a project
  2. Activate the Google Places API for iOS
  3. Create appropriate keys
Continue

GMSPlace Class Reference

GMSPlace Class Reference

Overview

Represents a particular physical place.

A GMSPlace encapsulates information about a physical location, including its name, location, and any other information we might have about it. This class is immutable.

Properties

NSString * name
 Name of the place.
NSString * placeID
 Place ID of this place.
CLLocationCoordinate2D coordinate
 Location of the place.
GMSPlacesOpenNowStatus openNowStatus
 Represents the open now status of the place at the time that the place was created.
NSString * phoneNumber
 Phone number of this place, in international format, i.e.
NSString * formattedAddress
 Address of the place as a simple string.
float rating
 Five-star rating for this place based on user reviews.
GMSPlacesPriceLevel priceLevel
 Price level for this place, as integers from 0 to 4.
NSArray< NSString * > * types
 The types of this place.
NSURL * website
 Website for this place.
NSAttributedString * attributions
 The data provider attribution string for this place.
GMSCoordinateBounds * viewport
 The recommended viewport for this place.
NSArray< GMSAddressComponent * > * addressComponents
 An array of GMSAddressComponent objects representing the components in the place's address.

Property Documentation

- (NSString*) name [read, copy]

Name of the place.

- (NSString*) placeID [read, copy]

Place ID of this place.

- (CLLocationCoordinate2D) coordinate [read, assign]

Location of the place.

The location is not necessarily the center of the Place, or any particular entry or exit point, but some arbitrarily chosen point within the geographic extent of the Place.

Represents the open now status of the place at the time that the place was created.

- (NSString*) phoneNumber [read, copy]

Phone number of this place, in international format, i.e.

including the country code prefixed with "+". For example, Google Sydney's phone number is "+61 2 9374 4000".

- (NSString*) formattedAddress [read, copy]

Address of the place as a simple string.

- (float) rating [read, assign]

Five-star rating for this place based on user reviews.

Ratings range from 1.0 to 5.0. 0.0 means we have no rating for this place (e.g. because not enough users have reviewed this place).

- (GMSPlacesPriceLevel) priceLevel [read, assign]

Price level for this place, as integers from 0 to 4.

e.g. A value of 4 means this place is "$$$$" (expensive). A value of 0 means free (such as a museum with free admission).

- (NSArray<NSString *>*) types [read, copy]

The types of this place.

Types are NSStrings, valid values are any types documented at <https://developers.google.com/places/ios-api/supported_types>.

- (NSURL*) website [read, copy]

Website for this place.

- (NSAttributedString*) attributions [read, copy]

The data provider attribution string for this place.

These are provided as a NSAttributedString, which may contain hyperlinks to the website of each provider.

In general, these must be shown to the user if data from this GMSPlace is shown, as described in the Places API Terms of Service.

- (GMSCoordinateBounds*) viewport [read, assign]

The recommended viewport for this place.

May be nil if the size of the place is not known.

This returns a viewport of a size that is suitable for displaying this place. For example, a GMSPlace object representing a store may have a relatively small viewport, while a GMSPlace object representing a country may have a very large viewport.

- (NSArray<GMSAddressComponent *>*) addressComponents [read, copy]

An array of GMSAddressComponent objects representing the components in the place's address.

These components are provided for the purpose of extracting structured information about the place's address: for example, finding the city that a place is in.

These components should not be used for address formatting. If a formatted address is required, use the formattedAddress property, which provides a localized formatted address.

Send feedback about...

location_on
Google Places API for iOS