GooglePlaces Framework Reference

GMSPlaceReview

@interface GMSPlaceReview : NSObject

This class represents a single place review.

  • Instantiates a GMSPlaceReview with detail properties.

    Declaration

    Swift

    init(publishDate: Date, relativePublishDateDescription: String?, text: String?, textLanguageCode: String?, originalText: String?, originalTextLanguageCode: String?, rating: Float, authorAttribution: GMSPlaceAuthorAttribution?)

    Objective-C

    - (nonnull instancetype)
                   initWithPublishDate:(nonnull NSDate *)publishDate
        relativePublishDateDescription:
            (nullable NSString *)relativePublishDateDescription
                                  text:(nullable NSString *)text
                      textLanguageCode:(nullable NSString *)textLanguageCode
                          originalText:(nullable NSString *)originalText
              originalTextLanguageCode:(nullable NSString *)originalTextLanguageCode
                                rating:(float)rating
                     authorAttribution:
                         (nullable GMSPlaceAuthorAttribution *)authorAttribution;

    Parameters

    publishDate

    The NSDate the review was published.

    relativePublishDateDescription

    The description of the publish date relative to the time of the request.

    text

    The localized text of the review.

    textLanguageCode

    The language code of the localized review text.

    originalText

    The review text in its original language.

    originalTextLanguageCode

    The language code the review was originally written in.

    rating

    The 0.0 - 5.0 rating associated with the review.

    authorAttribution

    The GMSPlaceAuthorAttribution of the review’s author.

  • Instantiates a GMSPlaceReview with detail properties.

    Declaration

    Swift

    init(publishDate: Date, relativePublishDateDescription: String?, text: String?, textLanguageCode: String?, originalText: String?, originalTextLanguageCode: String?, rating: Float, authorAttribution: GMSPlaceAuthorAttribution?, visitYear: UInt, visitMonth: UInt)

    Objective-C

    - (nonnull instancetype)
                   initWithPublishDate:(nonnull NSDate *)publishDate
        relativePublishDateDescription:
            (nullable NSString *)relativePublishDateDescription
                                  text:(nullable NSString *)text
                      textLanguageCode:(nullable NSString *)textLanguageCode
                          originalText:(nullable NSString *)originalText
              originalTextLanguageCode:(nullable NSString *)originalTextLanguageCode
                                rating:(float)rating
                     authorAttribution:
                         (nullable GMSPlaceAuthorAttribution *)authorAttribution
                             visitYear:(NSUInteger)visitYear
                            visitMonth:(NSUInteger)visitMonth;

    Parameters

    publishDate

    The NSDate the review was published.

    relativePublishDateDescription

    The description of the publish date relative to the time of the request.

    text

    The localized text of the review.

    textLanguageCode

    The language code of the localized review text.

    originalText

    The review text in its original language.

    originalTextLanguageCode

    The language code the review was originally written in.

    rating

    The 0.0 - 5.0 rating associated with the review.

    authorAttribution

    The GMSPlaceAuthorAttribution of the review’s author.

    visitYear

    The year the user visited the place.

    visitMonth

    The month the user visited the place.

  • The NSDate the review was published.

    Declaration

    Swift

    var publishDate: Date { get }

    Objective-C

    @property (nonatomic, copy, readonly) NSDate *_Nonnull publishDate;
  • A formatted string expressing the review date/time to the current time. Specific to the language and country (e.g. “6 months ago”).

    Declaration

    Swift

    var relativePublishDateDescription: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *relativePublishDateDescription;
  • The text of the review.

    Declaration

    Swift

    var text: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *text;
  • The language code of the text of the review.

    Declaration

    Swift

    var textLanguageCode: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *textLanguageCode;
  • The text of the review in its original language.

    Declaration

    Swift

    var originalText: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *originalText;
  • The language code of the original text of the review.

    Declaration

    Swift

    var originalTextLanguageCode: String? { get }

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *originalTextLanguageCode;
  • A whole number between 1.0 and 5.0, a.k.a. the number of stars.

    Declaration

    Swift

    var rating: Double { get }

    Objective-C

    @property (nonatomic, readonly) double rating;
  • The attribution that must be shown to the user if this review is displayed.

    See Other Attribution Requirements for more details.

    Declaration

    Swift

    var authorAttribution: GMSPlaceAuthorAttribution? { get }

    Objective-C

    @property (nonatomic, readonly, nullable) GMSPlaceAuthorAttribution *authorAttribution;
  • The year when the user visited the place. 0 is unset.

    Declaration

    Swift

    var visitYear: UInt { get }

    Objective-C

    @property (nonatomic, readonly) NSUInteger visitYear;
  • The month when the review author visited the place. This value is 1-based, so 1 is January and 12 is December. 0 is unset.

    Declaration

    Swift

    var visitMonth: UInt { get }

    Objective-C

    @property (nonatomic, readonly) NSUInteger visitMonth;