To discuss and provide feedback on our products, join the official AdMob Discord channel in the Google Advertising and Measurement Community server.

GoogleMobileAds Framework Reference

  • GADCustomNativeAdDelegate helps identify native ad assets and provides lifecycle event callbacks.

  • It includes methods to track impressions and clicks on custom native ads.

  • This delegate also provides notifications for click-time lifecycle events such as presenting and dismissing full-screen views.

  • Developers can use these callbacks to manage application behavior in response to ad interactions, like pausing animations or restarting them.

  • These methods help to integrate custom native ads seamlessly into an application and manage the user experience around ad interactions.

GADCustomNativeAdDelegate

@protocol GADCustomNativeAdDelegate <NSObject>

Identifies native ad assets.

  • Called just before presenting the user a full screen view, such as a browser, in response to clicking on an ad. Use this opportunity to stop animations, time sensitive interactions, etc.

    Normally the user looks at the ad, dismisses it, and control returns to your application with the customNativeAdDidDismissScreen: message. However, if the user hits the Home button or clicks on an App Store link, your application will end. The next method called will be the applicationWillResignActive: of your UIApplicationDelegate object.

    Declaration

    Swift

    @MainActor optional func customNativeAdWillPresentScreen(_ nativeAd: GADCustomNativeAd)

    Objective-C

    - (void)customNativeAdWillPresentScreen:(nonnull GADCustomNativeAd *)nativeAd;
  • Called just before dismissing a full screen view.

    Declaration

    Swift

    @MainActor optional func customNativeAdWillDismissScreen(_ nativeAd: GADCustomNativeAd)

    Objective-C

    - (void)customNativeAdWillDismissScreen:(nonnull GADCustomNativeAd *)nativeAd;
  • Called just after dismissing a full screen view. Use this opportunity to restart anything you may have stopped as part of customNativeAdWillPresentScreen:.

    Declaration

    Swift

    @MainActor optional func customNativeAdDidDismissScreen(_ nativeAd: GADCustomNativeAd)

    Objective-C

    - (void)customNativeAdDidDismissScreen:(nonnull GADCustomNativeAd *)nativeAd;

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 2025年08月20日 UTC.