GoogleMobileAds Framework Reference

GADMediatedUnifiedNativeAd

@protocol GADMediatedUnifiedNativeAd <NSObject>

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

  • Headline.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSArray<GADNativeAdImage *> *images;
  • Description.

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *callToAction;
  • 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;
  • Returns a dictionary of asset names and object pairs for assets that are not handled by properties of the GADMediatedUnifiedNativeAd.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        NSDictionary<NSString *, id> *extraAssets;
  • AdChoices view.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic, nullable) UIView *adChoicesView;
  • Media view.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic, nullable) UIView *mediaView;
  • Indicates whether the ad has video content.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) BOOL hasVideoContent;
  • Media content aspect ratio (width/height) or 0 if there’s no media content.

    Declaration

    Objective-C

    @optional
    @property (readonly, nonatomic) CGFloat mediaContentAspectRatio;
  • 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

    Objective-C

    - (void)didRenderInView:(nonnull UIView *)view
           clickableAssetViews:
               (nonnull NSDictionary<GADUnifiedNativeAssetIdentifier, UIView *> *)
                   clickableAssetViews
        nonclickableAssetViews:
            (nonnull NSDictionary<GADUnifiedNativeAssetIdentifier, UIView *> *)
                nonclickableAssetViews
                viewController:(nonnull UIViewController *)viewController;
  • Tells the receiver that an impression is recorded. This method is called only once per mediated native ad.

    Declaration

    Objective-C

    - (void)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

    Objective-C

    - (void)didRecordClickOnAssetWithName:
                (nonnull GADUnifiedNativeAssetIdentifier)assetName
                                     view:(nonnull UIView *)view
                           viewController:
                               (nonnull UIViewController *)viewController;
  • 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

    Objective-C

    - (void)didUntrackView:(nullable UIView *)view;