GADUnifiedNativeAd

@interface GADUnifiedNativeAd : NSObject

Unified native ad. To request this ad type, pass kGADAdLoaderAdTypeUnifiedNative (see GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader’s initializer method. If you request this ad type, your delegate must conform to the GADUnifiedNativeAdLoaderDelegate protocol.

  • Headline

    Declaration

    Swift

    var headline: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *headline;
  • Text that encourages user to take some action with the ad. For example Install.

    Declaration

    Swift

    var callToAction: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *callToAction;
  • Icon image.

    Declaration

    Swift

    var icon: GADNativeAdImage? { get }

    Objective-C

    @property (readonly, strong, nonatomic, nullable) GADNativeAdImage *icon;
  • Description.

    Declaration

    Swift

    var body: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *body;
  • Array of GADNativeAdImage objects.

    Declaration

    Swift

    var images: [GADNativeAdImage]? { get }

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        NSArray<GADNativeAdImage *> *images;
  • App store rating (0 to 5).

    Declaration

    Swift

    @NSCopying var starRating: NSDecimalNumber? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSDecimalNumber *starRating;
  • The app store name. For example, App Store.

    Declaration

    Swift

    var store: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *store;
  • String representation of the app’s price.

    Declaration

    Swift

    var price: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *price;
  • Identifies the advertiser. For example, the advertiser’s name or visible URL.

    Declaration

    Swift

    var advertiser: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *advertiser;
  • Video controller for controlling video playback in GADUnifiedNativeAdView’s mediaView.

    Declaration

    Swift

    var videoController: GADVideoController? { get }

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        GADVideoController *videoController;
  • Optional delegate to receive state change notifications.

    Declaration

    Swift

    weak var delegate: GADUnifiedNativeAdDelegate? { get set }

    Objective-C

    @property (readwrite, nonatomic, nullable) id<GADUnifiedNativeAdDelegate>
        delegate;
  • Root view controller for handling ad actions.

    Declaration

    Swift

    var rootViewController: UnsafeMutablePointer<Int32>? { get set }

    Objective-C

    @property(nonatomic, weak, nullable) UIViewController *rootViewController
  • Dictionary of assets which aren’t processed by the receiver.

    Declaration

    Swift

    var extraAssets: [String : Any]? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        NSDictionary<NSString *, id> *extraAssets;
  • The ad network class name that fetched the current ad. For both standard and mediated Google AdMob ads, this method returns @GADMAdapterGoogleAdMobAds. For ads fetched via mediation custom events, this method returns @GADMAdapterCustomEvents.

    Declaration

    Swift

    var adNetworkClassName: String? { get }

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *adNetworkClassName;
  • Registers ad view, clickable asset views, and nonclickable asset views with this native ad. Media view shouldn’t be registered as clickable.

    Declaration

    Swift

    func registerView(_ adView: Any!, clickableAssetViews: [AnyHashable : Any], nonclickableAssetViews: [AnyHashable : Any])

    Objective-C

    - (void)registerAdView:(id)adView
           clickableAssetViews:(nonnull NSDictionary *)clickableAssetViews
        nonclickableAssetViews:(nonnull NSDictionary *)nonclickableAssetViews;

    Parameters

    clickableAssetViews

    Dictionary of asset views that are clickable, keyed by asset IDs.

    nonclickableAssetViews

    Dictionary of asset views that are not clickable, keyed by asset IDs.

  • Unregisters ad view from this native ad. The corresponding asset views will also be unregistered.

    Declaration

    Swift

    func unregisterAdView()

    Objective-C

    - (void)unregisterAdView;
  • Unconfirmed click delegate.

    Declaration

    Swift

    weak var unconfirmedClickDelegate: GADUnifiedNativeAdUnconfirmedClickDelegate? { get set }

    Objective-C

    @property (readwrite, nonatomic, nullable)
        id<GADUnifiedNativeAdUnconfirmedClickDelegate>
            unconfirmedClickDelegate;
  • Registers a view that will confirm the click.

    Declaration

    Swift

    func registerClickConfirmingView(_ view: Any!)

    Objective-C

    - (void)registerClickConfirmingView:(id)view;
  • Cancels the unconfirmed click. Called when user fails to confirm the click. When this method is called, SDK stops tracking click on the registered click confirming view and invokes the -nativeAdDidCancelUnconfirmedClick: delegate method. If there’s no ongoing unconfirmed click, this method is no-op.

    Declaration

    Swift

    func cancelUnconfirmedClick()

    Objective-C

    - (void)cancelUnconfirmedClick;