GoogleMobileAds Framework Reference

Constants

The following constants are available globally.

  • Add this constant to the testDevices property’s array to receive test ads on the simulator.

    Declaration

    Swift

    letkDFPSimulatorID:AnyObject
  • Use with GADAdLoader to request native app install ads. To receive ads, the ad loader’s delegatemust conform to the GADNativeAppInstallAdLoaderDelegate protocol. See GADNativeAppInstallAd.h.

    See GADNativeAdImageAdLoaderOptions.h for ad loader image options.

    Declaration

    Swift

    staticletnativeAppInstall:GADAdLoaderAdType
  • Use with GADAdLoader to request native content ads. To receive ads, the ad loader’s delegatemust conform to the GADNativeContentAdLoaderDelegate protocol. See GADNativeContentAd.h.

    See GADNativeAdImageAdLoaderOptions.h for ad loader image options.

    Declaration

    Swift

    staticletnativeContent:GADAdLoaderAdType
  • Use with GADAdLoader to request native custom template ads. To receive ads, the ad loader’sdelegate must conform to the GADNativeCustomTemplateAdLoaderDelegate protocol. SeeGADNativeCustomTemplateAd.h.

    Declaration

    Swift

    staticletnativeCustomTemplate:GADAdLoaderAdType
  • Use with GADAdLoader to request Google Ad Manager banner ads. To receive ads, the ad loader’sdelegate must conform to the DFPBannerAdLoaderDelegate protocol. See DFPBannerView.h.

    Declaration

    Swift

    staticletdfpBanner:GADAdLoaderAdType
  • Use with GADAdLoader to request native ads. To receive ads, the ad loader’s delegate mustconform to the GADUnifiedNativeAdLoaderDelegate protocol. See GADUnifiedNativeAd.h.

    Declaration

    Swift

    staticletunifiedNative:GADAdLoaderAdType
  • iPhone and iPod Touch ad size. Typically 320x50.

    Declaration

    Swift

    letkGADAdSizeBanner:GADAdSize
  • Taller version of kGADAdSizeBanner. Typically 320x100.

    Declaration

    Swift

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

    Declaration

    Swift

    letkGADAdSizeMediumRectangle:GADAdSize
  • Full Banner size for the iPad (especially in a UIPopoverController or inUIModalPresentationFormSheet). Typically 468x60.

    Declaration

    Swift

    letkGADAdSizeFullBanner:GADAdSize
  • Leaderboard size for the iPad. Typically 728x90.

    Declaration

    Swift

    letkGADAdSizeLeaderboard:GADAdSize
  • Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer this size. Typically120x600.

    Declaration

    Swift

    letkGADAdSizeSkyscraper:GADAdSize
  • An ad size that spans the full width of the application in portrait orientation. The height istypically 50 points on an iPhone/iPod UI, and 90 points tall on an iPad UI.

    Declaration

    Swift

    letkGADAdSizeSmartBannerPortrait:GADAdSize
  • An ad size that spans the full width of the application in landscape orientation. The height istypically 32 points on an iPhone/iPod UI, and 90 points tall on an iPad UI.

    Declaration

    Swift

    letkGADAdSizeSmartBannerLandscape:GADAdSize
  • An ad size that spans the full width of its container, with a height dynamically determined bythe ad.

    Declaration

    Swift

    letkGADAdSizeFluid:GADAdSize
  • Invalid ad size marker.

    Declaration

    Swift

    letkGADAdSizeInvalid:GADAdSize
  • Key for getting the server parameter configured in AdMob when mediating to a custom eventadapter.Example: NSString *serverParameter = connector.credentials[GADCustomEventParametersServer].

    Declaration

    Swift

    letGADCustomEventParametersServer:String
  • Add this constant to the testDevices property’s array to receive test ads on the simulator.

    Declaration

    Swift

    letkGADSimulatorID:AnyObject
  • Google AdMob Ads error domain.

    Declaration

    Swift

    letkGADErrorDomain:String

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-03-03 UTC.