GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
protocol GADMediatedUnifiedNativeAd : NSObjectProtocol
Provides methods used for constructing native ads. The adapter must return an object conforming
to this protocol for native ad requests.
-
Declaration
Swift
var headline: String? { get }
-
Array of GADNativeAdImage objects.
-
Declaration
Swift
var body: String? { 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 }
-
Declaration
Swift
optional var adChoicesView: UIView? { get }
-
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.
-
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.
-
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?)
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 2021-03-03 UTC.
[null,null,["Last updated 2021-03-03 UTC."],[],[],null,["# GoogleMobileAds Framework Reference\n\nGADMediatedUnifiedNativeAd\n==========================\n\n protocol GADMediatedUnifiedNativeAd : NSObjectProtocol\n\nProvides methods used for constructing native ads. The adapter must return an object conforming\nto this protocol for native ad requests.\n- `\n ``\n ``\n `\n\n ### [headline](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)headline)\n\n `\n ` \n Headline. \n\n #### Declaration\n\n Swift \n\n var headline: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [images](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)images)\n\n `\n ` \n Array of GADNativeAdImage objects. \n\n #### Declaration\n\n Swift \n\n var images: [../Classes/GADNativeAdImage.html]? { get }\n\n- `\n ``\n ``\n `\n\n ### [body](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)body)\n\n `\n ` \n Description. \n\n #### Declaration\n\n Swift \n\n var body: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [icon](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)icon)\n\n `\n ` \n Icon image. \n\n #### Declaration\n\n Swift \n\n var icon: ../Classes/GADNativeAdImage.html? { get }\n\n- `\n ``\n ``\n `\n\n ### [callToAction](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)callToAction)\n\n `\n ` \n Text that encourages user to take some action with the ad. For example Install. \n\n #### Declaration\n\n Swift \n\n var callToAction: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [starRating](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)starRating)\n\n `\n ` \n App store rating (0 to 5). \n\n #### Declaration\n\n Swift \n\n @NSCopying var starRating: NSDecimalNumber? { get }\n\n- `\n ``\n ``\n `\n\n ### [store](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)store)\n\n `\n ` \n The app store name. For example, App Store. \n\n #### Declaration\n\n Swift \n\n var store: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [price](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)price)\n\n `\n ` \n String representation of the app's price. \n\n #### Declaration\n\n Swift \n\n var price: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [advertiser](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)advertiser)\n\n `\n ` \n Identifies the advertiser. For example, the advertiser's name or visible URL. \n\n #### Declaration\n\n Swift \n\n var advertiser: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [extraAssets](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)extraAssets)\n\n `\n ` \n Returns a dictionary of asset names and object pairs for assets that are not handled by\n properties of the GADMediatedUnifiedNativeAd. \n\n #### Declaration\n\n Swift \n\n var extraAssets: [String : Any]? { get }\n\n- `\n ``\n ``\n `\n\n ### [adChoicesView](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)adChoicesView)\n\n `\n ` \n AdChoices view. \n\n #### Declaration\n\n Swift \n\n optional var adChoicesView: UIView? { get }\n\n- `\n ``\n ``\n `\n\n ### [mediaView](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)mediaView)\n\n `\n ` \n Media view. \n\n #### Declaration\n\n Swift \n\n optional var mediaView: UIView? { get }\n\n- `\n ``\n ``\n `\n\n ### [hasVideoContent](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)hasVideoContent)\n\n `\n ` \n Indicates whether the ad has video content. \n\n #### Declaration\n\n Swift \n\n optional var hasVideoContent: Bool { get }\n\n- `\n ``\n ``\n `\n\n ### [mediaContentAspectRatio](#/c:objc(pl)GADMediatedUnifiedNativeAd(py)mediaContentAspectRatio)\n\n `\n ` \n Media content aspect ratio (width/height) or 0 if there's no media content. \n\n #### Declaration\n\n Swift \n\n optional var mediaContentAspectRatio: CGFloat { get }\n\n- `\n ``\n ``\n `\n\n ### [didRender(in:clickableAssetViews:nonclickableAssetViews:viewController:)](#/c:objc(pl)GADMediatedUnifiedNativeAd(im)didRenderInView:clickableAssetViews:nonclickableAssetViews:viewController:)\n\n `\n ` \n Tells the receiver that it has been rendered in \\|view\\| with clickable asset views and\n nonclickable asset views. viewController should be used to present modal views for the ad. \n\n #### Declaration\n\n Swift \n\n optional func didRender(in view: UIView, clickableAssetViews: [../Type Definitions.html#/c:GADUnifiedNativeAdAssetIdentifiers.h@T@GADUnifiedNativeAssetIdentifier : UIView], nonclickableAssetViews: [../Type-Definitions.html#/c:GADUnifiedNativeAdAssetIdentifiers.h@T@GADUnifiedNativeAssetIdentifier : UIView], viewController: UIViewController)\n\n- `\n ``\n ``\n `\n\n ### [didRecordImpression()](#/c:objc(pl)GADMediatedUnifiedNativeAd(im)didRecordImpression)\n\n `\n ` \n Tells the receiver that an impression is recorded. This method is called only once per mediated\n native ad. \n\n #### Declaration\n\n Swift \n\n optional func didRecordImpression()\n\n- `\n ``\n ``\n `\n\n ### [didRecordClickOnAsset(withName:view:viewController:)](#/c:objc(pl)GADMediatedUnifiedNativeAd(im)didRecordClickOnAssetWithName:view:viewController:)\n\n `\n ` \n Tells the receiver that a user click is recorded on the asset named \\|assetName\\|. Full screen\n actions should be presented from viewController. This method is called only if\n -\\[GADMAdNetworkAdapter handlesUserClicks\\] returns NO. \n\n #### Declaration\n\n Swift \n\n optional func didRecordClickOnAsset(withName assetName: ../Type-Definitions.html#/c:GADUnifiedNativeAdAssetIdentifiers.h@T@GADUnifiedNativeAssetIdentifier, view: UIView, viewController: UIViewController)\n\n- `\n ``\n ``\n `\n\n ### [didUntrackView(_:)](#/c:objc(pl)GADMediatedUnifiedNativeAd(im)didUntrackView:)\n\n `\n ` \n Tells the receiver that it has untracked \\|view\\|. This method is called when the mediated native\n ad is no longer rendered in the provided view and the delegate should stop tracking the view's\n impressions and clicks. The method may also be called with a nil view when the view in which the\n mediated native ad has rendered is deallocated. \n\n #### Declaration\n\n Swift \n\n optional func didUntrackView(_ view: UIView?)"]]