GoogleMobileAds Framework Reference Stay organized with collections Save and categorize content based on your preferences.
DFPBannerView
@interfaceDFPBannerView:GADBannerViewThe view that displays Ad Manager banner ads.
To request this ad type using GADAdLoader, you need to pass kGADAdLoaderAdTypeDFPBanner (seeGADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader’s initializer method. If yourequest this ad type, your delegate must conform to the DFPBannerAdLoaderDelegate protocol.
Required value created on the Ad Manager website. Create a new ad unit for every uniqueplacement of an ad in your application. Set this to the ID assigned for this placement. Ad unitsare important for targeting and statistics.
Example Ad Manager ad unit ID: @
/6499/example/banner
Declaration
Objective-C
@property(readwrite,copy,nonatomic,nullable)NSString*adUnitID;Optional delegate that is notified when creatives send app events.
Declaration
Objective-C
@property(readwrite,nonatomic,nullable)id<GADAppEventDelegate>appEventDelegate;Optional delegate that is notified when creatives cause the banner to change size.
Declaration
Objective-C
@property(readwrite,nonatomic,nullable)id<GADAdSizeDelegate>adSizeDelegate;Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that areappropriate for this slot. Never create your own GADAdSize directly. Use one of the predefinedstandard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSizemethod.
Example:
NSArray *validSizes = @[ NSValueFromGADAdSize(kGADAdSizeBanner), NSValueFromGADAdSize(kGADAdSizeLargeBanner) ];
bannerView.validAdSizes = validSizes;
Declaration
Objective-C
@property(readwrite,copy,nonatomic,nullable)NSArray<NSValue*>*validAdSizes;Correlator object for correlating this object to other ad objects.
Declaration
Objective-C
@property(assign,readwrite,nonatomic,nullable)GADCorrelator*correlator;Indicates that the publisher will record impressions manually when the ad becomes visible to theuser.
Declaration
Objective-C
@property(assign,readwrite,nonatomic)BOOLenableManualImpressions;Optional delegate object for custom rendered ads.
Declaration
Objective-C
@property(readwrite,nonatomic,nullable)id<DFPCustomRenderedBannerViewDelegate>customRenderedBannerViewDelegate;Video controller for controlling video rendered by this ad view.
Declaration
Objective-C
@property(readonly,nonatomic,nonnull)GADVideoController*videoController;If you’ve set enableManualImpressions to YES, call this method when the ad is visible.
Declaration
Objective-C
-(void)recordImpression;Use this function to resize the banner view without launching a new ad request.
Declaration
Objective-C
-(void)resize:(GADAdSize)size;Sets options that configure ad loading.
Declaration
Objective-C
-(void)setAdOptions:(nonnullNSArray<GADAdLoaderOptions*>*)adOptions;Parameters
adOptionsAn array of GADAdLoaderOptions objects. The array is deep copied and optionobjects cannot be modified after calling this method.
Deprecated. Use the validAdSizes property.Sets the receiver’s valid ad sizes to the values pointed to by the provided NULL terminated listof GADAdSize pointers.
Example:
GADAdSize size1 = kGADAdSizeBanner; GADAdSize size2 = kGADAdSizeLargeBanner; [bannerView setValidAdSizesWithSizes:&size1, &size2, nil];
Declaration
Objective-C
-(void)setValidAdSizesWithSizes:(nullableGADAdSize*)firstSize,...;
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.