commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GADBannerView.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2011 Google LLC. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <GoogleMobileAds/GADAdSize.h> |
|
9 |
#import <GoogleMobileAds/GADAdSizeDelegate.h> |
|
10 |
#import <GoogleMobileAds/GADAdValue.h> |
|
11 |
#import <GoogleMobileAds/GADBannerViewDelegate.h> |
|
12 |
#import <GoogleMobileAds/GADRequest.h> |
|
13 |
#import <GoogleMobileAds/GADResponseInfo.h> |
|
14 |
#import <UIKit/UIKit.h> |
|
15 |
|
|
16 |
/// A view that displays banner ads. See https://developers.google.com/admob/ios/banner to get |
|
17 |
/// started. |
|
18 |
@interface GADBannerView : UIView |
|
19 |
|
|
20 |
#pragma mark Initialization |
|
21 |
|
|
22 |
/// Initializes and returns a banner view with the specified ad size and origin relative to the |
|
23 |
/// banner's superview. |
|
24 |
- (nonnull instancetype)initWithAdSize:(GADAdSize)adSize origin:(CGPoint)origin; |
|
25 |
|
|
26 |
/// Initializes and returns a banner view with the specified ad size placed at its superview's |
|
27 |
/// origin. |
|
28 |
- (nonnull instancetype)initWithAdSize:(GADAdSize)adSize; |
|
29 |
|
|
30 |
#pragma mark Pre-Request |
|
31 |
|
|
32 |
/// Required value created on the AdMob website. Create a new ad unit for every unique placement of |
|
33 |
/// an ad in your application. Set this to the ID assigned for this placement. Ad units are |
|
34 |
/// important for targeting and statistics. |
|
35 |
/// |
|
36 |
/// Example AdMob ad unit ID: @"ca-app-pub-0123456789012345/0123456789" |
|
37 |
@property(nonatomic, copy, nullable) IBInspectable NSString *adUnitID; |
|
38 |
|
|
39 |
/// Reference to a root view controller that is used by the banner to present full screen |
|
40 |
/// content after the user interacts with the ad. If this is nil, the view controller containing the |
|
41 |
/// banner view is used. |
|
42 |
@property(nonatomic, weak, nullable) IBOutlet UIViewController *rootViewController; |
|
43 |
|
|
44 |
/// Required to set this banner view to a proper size. Never create your own GADAdSize directly. |
|
45 |
/// Use one of the predefined standard ad sizes (such as GADAdSizeBanner), or create one using the |
|
46 |
/// GADAdSizeFromCGSize method. If not using mediation, then changing the adSize after an ad has |
|
47 |
/// been shown will cause a new request (for an ad of the new size) to be sent. If using mediation, |
|
48 |
/// then a new request may not be sent. |
|
49 |
@property(nonatomic, assign) GADAdSize adSize; |
|
50 |
|
|
51 |
/// Optional delegate object that receives state change notifications from this GADBannerView. |
|
52 |
/// Typically this is a UIViewController. |
|
53 |
@property(nonatomic, weak, nullable) IBOutlet id<GADBannerViewDelegate> delegate; |
|
54 |
|
|
55 |
/// Optional delegate that is notified when creatives cause the banner to change size. |
|
56 |
@property(nonatomic, weak, nullable) IBOutlet id<GADAdSizeDelegate> adSizeDelegate; |
|
57 |
|
|
58 |
#pragma mark Making an Ad Request |
|
59 |
|
|
60 |
/// Requests an ad. The request object supplies targeting information. |
|
61 |
- (void)loadRequest:(nullable GADRequest *)request; |
|
62 |
|
|
63 |
/// A Boolean value that determines whether autoloading of ads in the receiver is enabled. If |
|
64 |
/// enabled, you do not need to call the loadRequest: method to load ads. |
|
65 |
@property(nonatomic, assign, getter=isAutoloadEnabled) IBInspectable BOOL autoloadEnabled; |
|
66 |
|
|
67 |
#pragma mark Response |
|
68 |
|
|
69 |
/// Information about the ad response that returned the current ad or an error. Nil until the first |
|
70 |
/// ad request succeeds or fails. |
|
71 |
@property(nonatomic, readonly, nullable) GADResponseInfo *responseInfo; |
|
72 |
|
|
73 |
/// Called when ad is estimated to have earned money. Available for allowlisted accounts only. |
|
74 |
@property(nonatomic, nullable, copy) GADPaidEventHandler paidEventHandler; |
|
75 |
|
|
76 |
/// Indicates whether the last loaded ad is a collapsible banner. |
|
77 |
@property(nonatomic, readonly) BOOL isCollapsible; |
|
78 |
|
|
79 |
@end |