# GoogleMobileAds Framework Reference

# GADCustomNativeAd


    @interface GADCustomNativeAd : NSObject

Custom native ad. To request this ad type, you need to pass
GADAdLoaderAdTypeCustomNative (see GADAdLoaderAdTypes.h) to the \|adTypes\| parameter
in GADAdLoader's initializer method. If you request this ad type, your delegate must conform to
the GADCustomNativeAdLoaderDelegate protocol.
- `


  ### [formatID](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)formatID)


  ` The ad's format ID.

  #### Declaration

  Swift

      var formatID: String { get }

  Objective-C

      @property (nonatomic, readonly, nonnull) NSString *formatID;

- `


  ### [availableAssetKeys](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)availableAssetKeys)


  ` Array of available asset keys.

  #### Declaration

  Swift

      var availableAssetKeys: [String] { get }

  Objective-C

      @property (nonatomic, readonly, nonnull) NSArray<NSString *> *availableAssetKeys;

- `


  ### [customClickHandler](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)customClickHandler)


  ` Custom click handler. Set this property only if this ad is configured with a custom click
  action, otherwise set it to nil. If this property is set to a non-nil value, the ad's built-in
  click actions are ignored and \|customClickHandler\| is executed when a click on the asset is
  received.

  #### Declaration

  Swift

      var customClickHandler: https://developers.google.com/admob/ios/api/reference/Type-Definitions.html#/c:GADCustomNativeAd.h@T@GADNativeAdCustomClickHandler? { get set }

  Objective-C

      @property (copy, nullable) https://developers.google.com/admob/ios/api/reference/Type-Definitions.html#/c:GADCustomNativeAd.h@T@GADNativeAdCustomClickHandler customClickHandler;

- `


  ### [displayAdMeasurement](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)displayAdMeasurement)


  ` The display ad measurement associated with this ad.

  #### Declaration

  Swift

      var displayAdMeasurement: DisplayAdMeasurement? { get }

  Objective-C

      @property (nonatomic, readonly, nullable) https://developers.google.com/admob/ios/api/reference/Classes/GADDisplayAdMeasurement.html *displayAdMeasurement;

- `


  ### [mediaContent](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)mediaContent)


  ` Media content.

  #### Declaration

  Swift

      var mediaContent: MediaContent { get }

  Objective-C

      @property (nonatomic, readonly, nonnull) https://developers.google.com/admob/ios/api/reference/Classes/GADMediaContent.html *mediaContent;

- `


  ### [delegate](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)delegate)


  ` Optional delegate to receive state change notifications.

  #### Declaration

  Swift

      weak var delegate: (any https://developers.google.com/admob/ios/api/reference/Protocols/GADCustomNativeAdDelegate.html)? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) id<https://developers.google.com/admob/ios/api/reference/Protocols/GADCustomNativeAdDelegate.html> delegate;

- `


  ### [rootViewController](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)rootViewController)


  ` 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

  Swift

      weak var rootViewController: UIViewController? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) UIViewController *rootViewController;

- `


  ### [responseInfo](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(py)responseInfo)


  ` Information about the ad response that returned the ad.

  #### Declaration

  Swift

      var responseInfo: ResponseInfo { get }

  Objective-C

      @property (nonatomic, readonly, nonnull) https://developers.google.com/admob/ios/api/reference/Classes/GADResponseInfo.html *responseInfo;

- `


  ### [-imageForKey:](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(im)imageForKey:)


  ` Returns the native ad image corresponding to the specified key or nil if the image is not
  available.

  #### Declaration

  Swift

      func image(forKey key: String) -> NativeAdImage?

  Objective-C

      - (nullable https://developers.google.com/admob/ios/api/reference/Classes/GADNativeAdImage.html *)imageForKey:(nonnull NSString *)key;

- `


  ### [-stringForKey:](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(im)stringForKey:)


  ` Returns the string corresponding to the specified key or nil if the string is not available.

  #### Declaration

  Swift

      func string(forKey key: String) -> String?

  Objective-C

      - (nullable NSString *)stringForKey:(nonnull NSString *)key;

- `


  ### [-performClickOnAssetWithKey:](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(im)performClickOnAssetWithKey:)


  ` Call when the user clicks on the ad. Provide the asset key that best matches the asset the user
  interacted with. If this ad is configured with a custom click action, ensure the receiver's
  customClickHandler property is set before calling this method.

  #### Declaration

  Swift

      func performClickOnAsset(withKey assetKey: String)

  Objective-C

      - (void)performClickOnAssetWithKey:(nonnull NSString *)assetKey;

- `


  ### [-recordImpression](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomNativeAd#/c:objc(cs)GADCustomNativeAd(im)recordImpression)


  ` Call when the ad is displayed on screen to the user. Can be called multiple times. Only the
  first impression is recorded.

  #### Declaration

  Swift

      func recordImpression()

  Objective-C

      - (void)recordImpression;