commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GADMAdNetworkConnectorProtocol.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2011 Google. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <GoogleMobileAds/Mediation/GADMediatedUnifiedNativeAd.h> |
|
9 |
#import <GoogleMobileAds/Mediation/GADMediationAdRequest.h> |
|
10 |
|
|
11 |
@protocol GADMAdNetworkAdapter; |
|
12 |
|
|
13 |
/// Ad network adapters interact with the mediation SDK using an object that implements the |
|
14 |
/// GADMAdNetworkConnector protocol. The connector object can be used to obtain necessary |
|
15 |
/// information for ad requests, and to call back to the mediation SDK on ad request returns and |
|
16 |
/// user interactions. |
|
17 |
@protocol GADMAdNetworkConnector <GADMediationAdRequest> |
|
18 |
|
|
19 |
/// When you need to show a landing page or any other modal view, such as when a user clicks or when |
|
20 |
/// your Ads SDK needs to show an interstitial, use this method to obtain a UIViewController that |
|
21 |
/// you can use to show your modal view. Call the -presentViewController:animated:completion: method |
|
22 |
/// of the returned UIViewController. |
|
23 |
- (UIViewController *)viewControllerForPresentingModalView; |
|
24 |
|
|
25 |
/// Returns the preferred ad volume as a fraction of system volume (0.0 to 1.0). |
|
26 |
- (float)adVolume; |
|
27 |
|
|
28 |
/// Returns whether the ad should be muted. |
|
29 |
- (BOOL)adMuted; |
|
30 |
|
|
31 |
#pragma mark - Adapter Callbacks |
|
32 |
|
|
33 |
/// Tells the connector that the adapter failed to receive an ad. |
|
34 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didFailAd:(NSError *)error; |
|
35 |
|
|
36 |
/// Tells the connector that the adapter received a banner ad. |
|
37 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didReceiveAdView:(UIView *)view; |
|
38 |
|
|
39 |
/// Tells the connector that the adapter received an interstitial. |
|
40 |
- (void)adapterDidReceiveInterstitial:(id<GADMAdNetworkAdapter>)adapter; |
|
41 |
|
|
42 |
/// Tells the connector that the adapter has received a unified mediated native ad. |
|
43 |
/// mediatedUnifiedNativeAd is used by the Google Mobile Ads SDK to construct a unified native ad |
|
44 |
/// object. |
|
45 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter |
|
46 |
didReceiveMediatedUnifiedNativeAd:(id<GADMediatedUnifiedNativeAd>)mediatedUnifiedNativeAd; |
|
47 |
|
|
48 |
#pragma mark Ad events |
|
49 |
|
|
50 |
// Adapter should call as many of these as possible, during the lifecycle of the loaded banner or |
|
51 |
// interstitial ad. |
|
52 |
|
|
53 |
/// Tells the connector that the adapter recorded a user click. |
|
54 |
- (void)adapterDidGetAdClick:(id<GADMAdNetworkAdapter>)adapter; |
|
55 |
|
|
56 |
// Adapter should call as many of these as possible, during the lifecycle of the loaded banner ad. |
|
57 |
|
|
58 |
/// Tells the connector that the adapter will present a full screen modal. |
|
59 |
- (void)adapterWillPresentFullScreenModal:(id<GADMAdNetworkAdapter>)adapter; |
|
60 |
/// Tells the connector that the adapter will dismiss a full screen modal. |
|
61 |
- (void)adapterWillDismissFullScreenModal:(id<GADMAdNetworkAdapter>)adapter; |
|
62 |
/// Tells the connector that the adapter dismissed a full screen modal. |
|
63 |
- (void)adapterDidDismissFullScreenModal:(id<GADMAdNetworkAdapter>)adapter; |
|
64 |
|
|
65 |
// Adapter should call these methods during the lifecycle of the loaded interstitial ad. |
|
66 |
|
|
67 |
/// Tells the connector that the adapter will present an interstitial. |
|
68 |
- (void)adapterWillPresentInterstitial:(id<GADMAdNetworkAdapter>)adapter; |
|
69 |
/// Tells the connector that the adapter will dismiss an interstitial. |
|
70 |
- (void)adapterWillDismissInterstitial:(id<GADMAdNetworkAdapter>)adapter; |
|
71 |
/// Tells the connector that the adapter did dismiss an interstitial. |
|
72 |
- (void)adapterDidDismissInterstitial:(id<GADMAdNetworkAdapter>)adapter; |
|
73 |
|
|
74 |
#pragma mark Deprecated |
|
75 |
|
|
76 |
/// Deprecated. Use -adapterDidReceiveInterstitial:. |
|
77 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter |
|
78 |
didReceiveInterstitial:(NSObject *)interstitial |
|
79 |
GAD_DEPRECATED_MSG_ATTRIBUTE("Use -adapterDidReceiveInterstitial:."); |
|
80 |
|
|
81 |
/// Deprecated. Use -adapterDidGetAdClick:. |
|
82 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter |
|
83 |
clickDidOccurInBanner:(UIView *)view |
|
84 |
GAD_DEPRECATED_MSG_ATTRIBUTE("Use -adapterDidGetAdClick:."); |
|
85 |
|
|
86 |
/// Deprecated. Use -adapter:didFailAd:. |
|
87 |
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter |
|
88 |
didFailInterstitial:(NSError *)error GAD_DEPRECATED_MSG_ATTRIBUTE("Use -adapter:didFailAd:"); |
|
89 |
|
|
90 |
/// Deprecated. No replacement. |
|
91 |
- (void)adapterWillLeaveApplication:(id<GADMAdNetworkAdapter>)adapter |
|
92 |
GAD_DEPRECATED_MSG_ATTRIBUTE("Deprecated. No replacement."); |
|
93 |
|
|
94 |
@end |