GoogleMobileAds Framework Reference

GADMediatedUnifiedNativeAd

protocol GADMediatedUnifiedNativeAd : NSObjectProtocol

Provides methods used for constructing native ads. The adapter must return an object conforming to this protocol for native ad requests.

  • Headline.

    Declaration

    Swift

    var headline: String? { get }
  • Array of GADNativeAdImage objects.

    Declaration

    Swift

    var images: [GADNativeAdImage]? { get }
  • Description.

    Declaration

    Swift

    var body: String? { get }
  • Icon image.

    Declaration

    Swift

    var icon: GADNativeAdImage? { get }
  • Text that encourages user to take some action with the ad. For example Install.

    Declaration

    Swift

    var callToAction: String? { get }
  • App store rating (0 to 5).

    Declaration

    Swift

    @NSCopying var starRating: NSDecimalNumber? { get }
  • The app store name. For example, App Store.

    Declaration

    Swift

    var store: String? { get }
  • String representation of the app’s price.

    Declaration

    Swift

    var price: String? { get }
  • Identifies the advertiser. For example, the advertiser’s name or visible URL.

    Declaration

    Swift

    var advertiser: String? { get }
  • Returns a dictionary of asset names and object pairs for assets that are not handled by properties of the GADMediatedUnifiedNativeAd.

    Declaration

    Swift

    var extraAssets: [String : Any]? { get }
  • AdChoices view.

    Declaration

    Swift

    optional var adChoicesView: UIView? { get }
  • Media view.

    Declaration

    Swift

    optional var mediaView: UIView? { get }
  • Indicates whether the ad has video content.

    Declaration

    Swift

    optional var hasVideoContent: Bool { get }
  • Media content aspect ratio (width/height) or 0 if there’s no media content.

    Declaration

    Swift

    optional var mediaContentAspectRatio: CGFloat { get }
  • Tells the receiver that it has been rendered in |view| with clickable asset views and nonclickable asset views. viewController should be used to present modal views for the ad.

    Declaration

    Swift

    optional func didRender(in view: UIView, clickableAssetViews: [GADUnifiedNativeAssetIdentifier : UIView], nonclickableAssetViews: [GADUnifiedNativeAssetIdentifier : UIView], viewController: UIViewController)
  • Tells the receiver that an impression is recorded. This method is called only once per mediated native ad.

    Declaration

    Swift

    optional func didRecordImpression()
  • Tells the receiver that a user click is recorded on the asset named |assetName|. Full screen actions should be presented from viewController. This method is called only if -[GADMAdNetworkAdapter handlesUserClicks] returns NO.

    Declaration

    Swift

    optional func didRecordClickOnAsset(withName assetName: GADUnifiedNativeAssetIdentifier, view: UIView, viewController: UIViewController)
  • Tells the receiver that it has untracked |view|. This method is called when the mediated native ad is no longer rendered in the provided view and the delegate should stop tracking the view’s impressions and clicks. The method may also be called with a nil view when the view in which the mediated native ad has rendered is deallocated.

    Declaration

    Swift

    optional func didUntrackView(_ view: UIView?)