commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GADMAdNetworkAdapterProtocol.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2011 Google. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <GoogleMobileAds/GADAdLoader.h> |
|
9 |
#import <GoogleMobileAds/GADAdSize.h> |
|
10 |
#import <GoogleMobileAds/Mediation/GADMAdNetworkConnectorProtocol.h> |
|
11 |
#import <UIKit/UIKit.h> |
|
12 |
|
|
13 |
/// Subclasses should prefix their name with "GADMAdapter" example: GADMAdapterGoogleAdMobAds |
|
14 |
#define GADMAdapterClassNamePrefix @"GADMAdapter" |
|
15 |
|
|
16 |
/// Ad network adapter protocol. |
|
17 |
@protocol GADMAdNetworkAdapter <NSObject> |
|
18 |
|
|
19 |
/// Returns a version string for the adapter. It can be any string that uniquely identifies the |
|
20 |
/// adapter's version. For example, "1.0", or a date such as "20110915". |
|
21 |
+ (NSString *)adapterVersion; |
|
22 |
|
|
23 |
/// Returns the extras class that is used by publishers to provide additional parameters to this |
|
24 |
/// adapter. Returns Nil if the adapter doesn't have extra publisher provided settings. |
|
25 |
+ (Class<GADAdNetworkExtras>)networkExtrasClass; |
|
26 |
|
|
27 |
/// Designated initializer. Adapters can and should store a weak reference to the connector. |
|
28 |
/// However, adapters must not keep a strong reference to the connector, as doing so creates a |
|
29 |
/// reference cycle and abandoned memory. |
|
30 |
- (instancetype)initWithGADMAdNetworkConnector:(id<GADMAdNetworkConnector>)connector; |
|
31 |
|
|
32 |
/// Asks the adapter to initiate an asynchronous banner ad request. The adapter may act as a |
|
33 |
/// delegate to your SDK to listen to callbacks. If your SDK doesn't support the given ad size, or |
|
34 |
/// doesn't support banner ads, call adapter:didFailAd: on the connector. |
|
35 |
- (void)getBannerWithSize:(GADAdSize)adSize; |
|
36 |
|
|
37 |
/// Asks the adapter to initiate an asynchronous interstitial ad request. The adapter may act as a |
|
38 |
/// delegate to your SDK to listen to callbacks. If your SDK doesn't support interstitials, call |
|
39 |
/// adapter:didFailInterstitial: on the connector. |
|
40 |
- (void)getInterstitial; |
|
41 |
|
|
42 |
/// When called, the adapter must remove strong references to itself (e.g., delegate properties and |
|
43 |
/// notification observers). You should also call this method in your adapter dealloc to prevent |
|
44 |
/// your SDK from interacting with the deallocated adapter. This function may be called multiple |
|
45 |
/// times. |
|
46 |
- (void)stopBeingDelegate; |
|
47 |
|
|
48 |
/// Presents an interstitial using the supplied UIViewController, by calling |
|
49 |
/// presentViewController:animated:completion:. |
|
50 |
/// |
|
51 |
/// Your interstitial should not immediately present itself when it is received. Instead, you should |
|
52 |
/// wait until this method is called on your adapter to present the interstitial. |
|
53 |
/// |
|
54 |
/// The adapter must call adapterWillPresentInterstitial: on the connector when the interstitial is |
|
55 |
/// about to be presented, and adapterWillDismissInterstitial: and adapterDidDismissInterstitial: |
|
56 |
/// when the interstitial is being dismissed. |
|
57 |
- (void)presentInterstitialFromRootViewController:(UIViewController *)rootViewController; |
|
58 |
|
|
59 |
@optional |
|
60 |
|
|
61 |
/// Asks the adapter to initiate an asynchronous native ad request. |adTypes| contains the list of |
|
62 |
/// native ad types requested. See GADAdLoaderAdTypes.h for available ad types. |options| contains |
|
63 |
/// additional options configured by the publisher. See GADNativeAdImageAdLoaderOptions.h for |
|
64 |
/// available image options. |
|
65 |
/// |
|
66 |
/// On ad load success or failure, call adapter:didReceiveNativeAdDataSource:mediationDelegate or |
|
67 |
/// adapter:didFailAd: on the connector. |
|
68 |
- (void)getNativeAdWithAdTypes:(NSArray<GADAdLoaderAdType> *)adTypes |
|
69 |
options:(NSArray<GADAdLoaderOptions *> *)options; |
|
70 |
|
|
71 |
/// Indicates if the adapter handles user clicks. If the adapter returns YES, it must handle user |
|
72 |
/// clicks and notify the Google Mobile Ads SDK of clicks using |
|
73 |
/// +[GADMediatedNativeAdNotificationSource mediatedNativeAdDidRecordClick:]. If the adapter returns |
|
74 |
/// NO, the Google Mobile Ads SDK handles user clicks and notifies the adapter of clicks using |
|
75 |
/// -[GADMediatedUnifiedNativeAd didRecordClickOnAssetWithName:view:viewController:]. |
|
76 |
- (BOOL)handlesUserClicks; |
|
77 |
|
|
78 |
/// Indicates if the adapter handles user impressions tracking. If the adapter returns YES, the |
|
79 |
/// Google Mobile Ads SDK will not track user impressions and the adapter must notify the |
|
80 |
/// Google Mobile Ads SDK of impressions using +[GADMediatedNativeAdNotificationSource |
|
81 |
/// mediatedNativeAdDidRecordImpression:]. If the adapter returns NO, the Google Mobile Ads SDK |
|
82 |
/// tracks user impressions and notifies the adapter of impressions using |
|
83 |
/// -[GADMediatedUnifiedNativeAd didRecordImpression]. |
|
84 |
- (BOOL)handlesUserImpressions; |
|
85 |
|
|
86 |
/// If your ad network handles multiple ad sizes for the same banner ad, implement this method to be |
|
87 |
/// informed of banner size updates. Ad sizes typically change between kGADAdSizeSmartBannerPortrait |
|
88 |
/// and kGADAdSizeSmartBannerLandscape. If this method is not implemented, the ad is removed from |
|
89 |
/// the user interface when the size changes. |
|
90 |
- (void)changeAdSizeTo:(GADAdSize)adSize; |
|
91 |
|
|
92 |
@end |