GoogleMobileAds Framework Reference

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

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<GADUnifiedNativeAdDelegate>
        delegate;
  • Reference to a root view controller that is used by the ad to present full screen content after the user interacts with the ad. The root view controller is most commonly the view controller displaying the ad.

    Declaration

    Objective-C

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

    Declaration

    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

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *adNetworkClassName;
  • Indicates whether custom Mute This Ad is available for the native ad.

    Declaration

    Objective-C

    @property (readonly, getter=isCustomMuteThisAdAvailable, nonatomic)
        BOOL customMuteThisAdAvailable;
  • An array of Mute This Ad reasons used to render customized mute ad survey. Use this array to implement your own Mute This Ad feature only when customMuteThisAdAvailable is YES.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable)
        NSArray<GADMuteThisAdReason *> *muteThisAdReasons;
  • Media content. Set the associated media view’s mediaContent property to this object to display this content.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    - (void)registerAdView:(nonnull UIView *)adView
           clickableAssetViews:
               (nonnull NSDictionary<GADUnifiedNativeAssetIdentifier, UIView *> *)
                   clickableAssetViews
        nonclickableAssetViews:
            (nonnull NSDictionary<GADUnifiedNativeAssetIdentifier, UIView *> *)
                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

    Objective-C

    - (void)unregisterAdView;
  • Reports the mute event with the mute reason selected by user. Use nil if no reason was selected. Call this method only if customMuteThisAdAvailable is YES.

    Declaration

    Objective-C

    - (void)muteThisAdWithReason:(nullable GADMuteThisAdReason *)reason;
  • Unconfirmed click delegate.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    - (void)registerClickConfirmingView:(nullable UIView *)view;
  • Cancels the unconfirmed click. Call this method when the user fails to confirm the click. Calling this method causes the SDK to stop tracking clicks on the registered click confirming view and invokes the -nativeAdDidCancelUnconfirmedClick: delegate method. If no unconfirmed click is in progress, this method has no effect.

    Declaration

    Objective-C

    - (void)cancelUnconfirmedClick;
  • Indicates whether the custom click gestures feature can be used.

    Declaration

    Objective-C

    @property (readonly, getter=isCustomClickGestureEnabled, nonatomic)
        BOOL customClickGestureEnabled;
  • Enables custom click gestures. Must be called before the ad is associated with an ad view. Available for whitelisted accounts only.

    Declaration

    Objective-C

    - (void)enableCustomClickGestures;
  • Records a click triggered by a custom click gesture.

    Declaration

    Objective-C

    - (void)recordCustomClickGesture;