GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
DFPBannerView
The view that displays Ad Manager banner ads.
To request this ad type using GADAdLoader, you need to pass kGADAdLoaderAdTypeDFPBanner (see
GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader’s initializer method. If you
request 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 unique
placement of an ad in your application. Set this to the ID assigned for this placement. Ad units
are 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 are
appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined
standard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize
method.
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 the
user.
Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL enableManualImpressions;
-
Optional delegate object for custom rendered ads.
-
Video controller for controlling video rendered by this ad view.
-
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.
-
Sets options that configure ad loading.
Parameters
adOptions
|
An array of GADAdLoaderOptions objects. The array is deep copied and option
objects 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 list
of GADAdSize pointers.
Example:
GADAdSize size1 = kGADAdSizeBanner;
GADAdSize size2 = kGADAdSizeLargeBanner;
[bannerView setValidAdSizesWithSizes:&size1, &size2, nil];
Declaration
Objective-C
- (void)setValidAdSizesWithSizes:(nullable GADAdSize *)firstSize, ...;
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 2021-03-03 UTC.
[null,null,["Last updated 2021-03-03 UTC."],[],[],null,["# GoogleMobileAds Framework Reference\n\nDFPBannerView\n=============\n\n @interface DFPBannerView : ../Classes/GADBannerView.html\n\nThe view that displays Ad Manager banner ads.\n\nTo request this ad type using GADAdLoader, you need to pass kGADAdLoaderAdTypeDFPBanner (see\nGADAdLoaderAdTypes.h) to the \\|adTypes\\| parameter in GADAdLoader's initializer method. If you\nrequest this ad type, your delegate must conform to the DFPBannerAdLoaderDelegate protocol.\n- `\n ``\n ``\n `\n\n ### [adUnitID](#/c:objc(cs)DFPBannerView(py)adUnitID)\n\n `\n ` \n Required value created on the Ad Manager website. Create a new ad unit for every unique\n placement of an ad in your application. Set this to the ID assigned for this placement. Ad units\n are important for targeting and statistics.\n\n Example Ad Manager ad unit ID: @/6499/example/banner \n\n #### Declaration\n\n Objective-C \n\n @property (readwrite, copy, nonatomic, nullable) NSString *adUnitID;\n\n- `\n ``\n ``\n `\n\n ### [appEventDelegate](#/c:objc(cs)DFPBannerView(py)appEventDelegate)\n\n `\n ` \n Optional delegate that is notified when creatives send app events. \n\n #### Declaration\n\n Objective-C \n\n @property (readwrite, nonatomic, nullable) id\u003c../Protocols/GADAppEventDelegate.html\u003e\n appEventDelegate;\n\n- `\n ``\n ``\n `\n\n ### [adSizeDelegate](#/c:objc(cs)DFPBannerView(py)adSizeDelegate)\n\n `\n ` \n Optional delegate that is notified when creatives cause the banner to change size. \n\n #### Declaration\n\n Objective-C \n\n @property (readwrite, nonatomic, nullable) id\u003c../Protocols/GADAdSizeDelegate.html\u003e adSizeDelegate;\n\n- `\n ``\n ``\n `\n\n ### [validAdSizes](#/c:objc(cs)DFPBannerView(py)validAdSizes)\n\n `\n ` \n Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are\n appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined\n standard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize\n method.\n\n Example:\n\n \u003cbr /\u003e\n\n ```\n NSArray *validSizes = @[\n NSValueFromGADAdSize(kGADAdSizeBanner),\n NSValueFromGADAdSize(kGADAdSizeLargeBanner)\n ];\n\n bannerView.validAdSizes = validSizes;\n \n ```\n\n \u003cbr /\u003e\n\n #### Declaration\n\n Objective-C \n\n @property (readwrite, copy, nonatomic, nullable)\n NSArray\u003cNSValue *\u003e *validAdSizes;\n\n- `\n ``\n ``\n `\n\n ### [correlator](#/c:objc(cs)DFPBannerView(py)correlator)\n\n `\n ` \n Correlator object for correlating this object to other ad objects. \n\n #### Declaration\n\n Objective-C \n\n @property (assign, readwrite, nonatomic, nullable) ../Classes/GADCorrelator.html *correlator;\n\n- `\n ``\n ``\n `\n\n ### [enableManualImpressions](#/c:objc(cs)DFPBannerView(py)enableManualImpressions)\n\n `\n ` \n Indicates that the publisher will record impressions manually when the ad becomes visible to the\n user. \n\n #### Declaration\n\n Objective-C \n\n @property (assign, readwrite, nonatomic) BOOL enableManualImpressions;\n\n- `\n ``\n ``\n `\n\n ### [customRenderedBannerViewDelegate](#/c:objc(cs)DFPBannerView(py)customRenderedBannerViewDelegate)\n\n `\n ` \n Optional delegate object for custom rendered ads. \n\n #### Declaration\n\n Objective-C \n\n @property (readwrite, nonatomic, nullable)\n id\u003c../Protocols/DFPCustomRenderedBannerViewDelegate.html\u003e\n customRenderedBannerViewDelegate;\n\n- `\n ``\n ``\n `\n\n ### [videoController](#/c:objc(cs)DFPBannerView(py)videoController)\n\n `\n ` \n Video controller for controlling video rendered by this ad view. \n\n #### Declaration\n\n Objective-C \n\n @property (readonly, nonatomic, nonnull) ../Classes/GADVideoController.html *videoController;\n\n- `\n ``\n ``\n `\n\n ### [-recordImpression](#/c:objc(cs)DFPBannerView(im)recordImpression)\n\n `\n ` \n If you've set enableManualImpressions to YES, call this method when the ad is visible. \n\n #### Declaration\n\n Objective-C \n\n - (void)recordImpression;\n\n- `\n ``\n ``\n `\n\n ### [-resize:](#/c:objc(cs)DFPBannerView(im)resize:)\n\n `\n ` \n Use this function to resize the banner view without launching a new ad request. \n\n #### Declaration\n\n Objective-C \n\n - (void)resize:(../Structs/GADAdSize.html)size;\n\n- `\n ``\n ``\n `\n\n ### [-setAdOptions:](#/c:objc(cs)DFPBannerView(im)setAdOptions:)\n\n `\n ` \n Sets options that configure ad loading. \n\n #### Declaration\n\n Objective-C \n\n - (void)setAdOptions:(nonnull NSArray\u003c../Classes.html#/c:objc(cs)GADAdLoaderOptions *\u003e *)adOptions;\n\n #### Parameters\n\n |-------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n | ` `*adOptions*` ` | An array of GADAdLoaderOptions objects. The array is deep copied and option objects cannot be modified after calling this method. |\n\n[Deprecated\n----------](#/Deprecated)\n\n- `\n ``\n ``\n `\n\n ### [-setValidAdSizesWithSizes:](#/c:objc(cs)DFPBannerView(im)setValidAdSizesWithSizes:)\n\n `\n ` \n Deprecated. Use the validAdSizes property.\n Sets the receiver's valid ad sizes to the values pointed to by the provided NULL terminated list\n of GADAdSize pointers.\n\n Example:\n\n \u003cbr /\u003e\n\n ```\n GADAdSize size1 = kGADAdSizeBanner;\n GADAdSize size2 = kGADAdSizeLargeBanner;\n [bannerView setValidAdSizesWithSizes:&size1, &size2, nil];\n \n ```\n\n \u003cbr /\u003e\n\n #### Declaration\n\n Objective-C \n\n - (void)setValidAdSizesWithSizes:(nullable ../Structs/GADAdSize.html *)firstSize, ...;"]]