commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GAMBannerView.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2012 Google LLC. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <GoogleMobileAds/GADAdLoader.h> |
|
9 |
#import <GoogleMobileAds/GADAdLoaderDelegate.h> |
|
10 |
#import <GoogleMobileAds/GADAppEventDelegate.h> |
|
11 |
#import <GoogleMobileAds/GADBannerView.h> |
|
12 |
#import <GoogleMobileAds/GADVideoController.h> |
|
13 |
|
|
14 |
@class GAMBannerView; |
|
15 |
|
|
16 |
/// The delegate of a GADAdLoader object must conform to this protocol to receive GAMBannerViews. |
|
17 |
@protocol GAMBannerAdLoaderDelegate <GADAdLoaderDelegate> |
|
18 |
|
|
19 |
/// Asks the delegate which banner ad sizes should be requested. |
|
20 |
- (nonnull NSArray<NSValue *> *)validBannerSizesForAdLoader:(nonnull GADAdLoader *)adLoader; |
|
21 |
|
|
22 |
/// Tells the delegate that a Google Ad Manager banner ad was received. |
|
23 |
- (void)adLoader:(nonnull GADAdLoader *)adLoader |
|
24 |
didReceiveGAMBannerView:(nonnull GAMBannerView *)bannerView; |
|
25 |
|
|
26 |
@end |
|
27 |
|
|
28 |
/// The view that displays Ad Manager banner ads. |
|
29 |
/// |
|
30 |
/// To request this ad type using GADAdLoader, you need to pass GADAdLoaderAdTypeGAMBanner (see |
|
31 |
/// GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader's initializer method. If you |
|
32 |
/// request this ad type, your delegate must conform to the GAMBannerAdLoaderDelegate protocol. |
|
33 |
@interface GAMBannerView : GADBannerView |
|
34 |
|
|
35 |
/// Required value created on the Ad Manager website. Create a new ad unit for every unique |
|
36 |
/// placement of an ad in your application. Set this to the ID assigned for this placement. Ad units |
|
37 |
/// are important for targeting and statistics. |
|
38 |
/// |
|
39 |
/// Example Ad Manager ad unit ID: @"/6499/example/banner" |
|
40 |
@property(nonatomic, copy, nullable) NSString *adUnitID; |
|
41 |
|
|
42 |
/// Optional delegate that is notified when creatives send app events. |
|
43 |
@property(nonatomic, weak, nullable) IBOutlet id<GADAppEventDelegate> appEventDelegate; |
|
44 |
|
|
45 |
/// Optional delegate that is notified when creatives cause the banner to change size. |
|
46 |
@property(nonatomic, weak, nullable) IBOutlet id<GADAdSizeDelegate> adSizeDelegate; |
|
47 |
|
|
48 |
/// Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are |
|
49 |
/// appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined |
|
50 |
/// standard ad sizes (such as GADAdSizeBanner), or create one using the GADAdSizeFromCGSize |
|
51 |
/// method. |
|
52 |
/// |
|
53 |
/// Example: |
|
54 |
/// |
|
55 |
/// \code |
|
56 |
/// NSArray *validSizes = @[ |
|
57 |
/// NSValueFromGADAdSize(GADAdSizeBanner), |
|
58 |
/// NSValueFromGADAdSize(GADAdSizeLargeBanner) |
|
59 |
/// ]; |
|
60 |
/// |
|
61 |
/// bannerView.validAdSizes = validSizes; |
|
62 |
/// \endcode |
|
63 |
@property(nonatomic, copy, nullable) NSArray<NSValue *> *validAdSizes; |
|
64 |
|
|
65 |
/// Indicates that the publisher will record impressions manually when the ad becomes visible to the |
|
66 |
/// user. |
|
67 |
@property(nonatomic) BOOL enableManualImpressions; |
|
68 |
|
|
69 |
/// Video controller for controlling video rendered by this ad view. |
|
70 |
@property(nonatomic, readonly, nonnull) GADVideoController *videoController; |
|
71 |
|
|
72 |
/// If you've set enableManualImpressions to YES, call this method when the ad is visible. |
|
73 |
- (void)recordImpression; |
|
74 |
|
|
75 |
/// Use this function to resize the banner view without launching a new ad request. |
|
76 |
- (void)resize:(GADAdSize)size; |
|
77 |
|
|
78 |
/// Sets options that configure ad loading. |
|
79 |
/// |
|
80 |
/// @param adOptions An array of GADAdLoaderOptions objects. The array is deep copied and option |
|
81 |
/// objects cannot be modified after calling this method. |
|
82 |
- (void)setAdOptions:(nonnull NSArray<GADAdLoaderOptions *> *)adOptions; |
|
83 |
|
|
84 |
@end |