GoogleMobileAds Framework Reference

  • Global constants are available for requesting different ad types with GADAdLoader, including custom native, GAM banner, and standard native ads.

  • The content defines standard ad sizes with their typical dimensions for iPhone, iPod Touch, and iPad devices.

  • Deprecated constants are listed, with recommendations for current usage.

  • Constants related to retrieving information from custom event adapters and native ad assets are provided.

  • Constants are available for setting the maximum ad content rating and for handling Google AdMob Ads errors, including error domains and user info keys.

Constants

The following constants are available globally.

  • Use with GADAdLoader to request native custom template ads. To receive ads, the ad loader’s delegate must conform to the GADCustomNativeAdLoaderDelegate protocol. See GADCustomNativeAd.h.

    Declaration

    Swift

     static let customNative: AdLoaderAdType 
    

    Objective-C

     extern GADAdLoaderAdType 
    _Nonnull const GADAdLoaderAdTypeCustomNative 
    
  • Use with GADAdLoader to request Google Ad Manager banner ads. To receive ads, the ad loader’s delegate must conform to the GAMBannerAdLoaderDelegate protocol. See GAMBannerView.h.

    Declaration

    Swift

     static let adManagerBanner: AdLoaderAdType 
    

    Objective-C

     extern NS_SWIFT_NAME GADAdLoaderAdType 
    GADAdLoaderAdTypeGAMBanner 
    
  • Use with GADAdLoader to request native ads. To receive ads, the ad loader’s delegate must conform to the GADNativeAdLoaderDelegate protocol. See GADNativeAd.h.

    Declaration

    Swift

     static let native: AdLoaderAdType 
    

    Objective-C

     extern GADAdLoaderAdType 
    _Nonnull const GADAdLoaderAdTypeNative 
    
  • iPhone and iPod Touch ad size. Typically 320x50.

    Declaration

    Swift

     let AdSizeBanner: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeBanner 
    
  • Taller version of GADAdSizeBanner. Typically 320x100.

    Declaration

    Swift

     let AdSizeLargeBanner: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeLargeBanner 
    
  • Medium Rectangle size for the iPad (especially in a UISplitView’s left pane). Typically 300x250.

    Declaration

    Swift

     let AdSizeMediumRectangle: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeMediumRectangle 
    
  • Full Banner size for the iPad (especially in a UIPopoverController or in UIModalPresentationFormSheet). Typically 468x60.

    Declaration

    Swift

     let AdSizeFullBanner: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeFullBanner 
    
  • Leaderboard size for the iPad. Typically 728x90.

    Declaration

    Swift

     let AdSizeLeaderboard: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeLeaderboard 
    
  • Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer this size. Typically 120x600.

    Declaration

    Swift

     let AdSizeSkyscraper: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeSkyscraper 
    
  • An ad size that spans the full width of its container, with a height dynamically determined by the ad.

    Declaration

    Swift

     let AdSizeFluid: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeFluid 
    
  • Invalid ad size marker.

    Declaration

    Swift

     let AdSizeInvalid: AdSize 
    

    Objective-C

     extern const GADAdSize 
    GADAdSizeInvalid 
    
Design a Mobile Site
View Site in Mobile | Classic
Share by: