lpw
2024-09-25 2f0847c51cfe186abd2c4fc554108edc1890d222
commit | author | age
dbf535 1 //
L 2 //  WAAdMobProxy.h
3 //  WASdkIntf
4 //
5 //  Created by lpw on 2024/5/27.
6 //  Copyright © 2024 GHW-T-01. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <UIKit/UIKit.h>
11
12
13
14 NS_ASSUME_NONNULL_BEGIN
15
16
17 @protocol GADFullScreenContentDelegate;
18
19 /// Protocol for ads that present full screen content.
20 @protocol GADFullScreenPresentingAd <NSObject>
21
22 /// Delegate object that receives full screen content messages.
23 @property(nonatomic, weak, nullable) id<GADFullScreenContentDelegate> fullScreenContentDelegate;
24
25 @end
26
27 /// Delegate methods for receiving notifications about presentation and dismissal of full screen
28 /// content. Full screen content covers your application's content. The delegate may want to pause
29 /// animations or time sensitive interactions. Full screen content may be presented in the following
30 /// cases:
31 /// 1. A full screen ad is presented.
32 /// 2. An ad interaction opens full screen content.
33 @protocol GADFullScreenContentDelegate <NSObject>
34
35 @optional
36
37 /// Tells the delegate that an impression has been recorded for the ad.
38 - (void)adDidRecordImpression:(nonnull id<GADFullScreenPresentingAd>)ad;
39
40 /// Tells the delegate that a click has been recorded for the ad.
41 - (void)adDidRecordClick:(nonnull id<GADFullScreenPresentingAd>)ad;
42
43 /// Tells the delegate that the ad failed to present full screen content.
44 - (void)ad:(nonnull id<GADFullScreenPresentingAd>)ad
45     didFailToPresentFullScreenContentWithError:(nonnull NSError *)error;
46
47 /// Tells the delegate that the ad will present full screen content.
48 - (void)adWillPresentFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
49
50 /// Tells the delegate that the ad will dismiss full screen content.
51 - (void)adWillDismissFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
52
53 /// Tells the delegate that the ad dismissed full screen content.
54 - (void)adDidDismissFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad;
55
56 /// Tells the delegate that the user earned a reward.
2f0847 57 //- (void)userDidEarnReward:(nonnull NSMutableDictionary*)rewardDic;
dbf535 58
L 59
60 #pragma mark - Unavailable
61
62 /// Unsupported. Delegates should implement adWillPresentFullScreenContent: instead.
63 - (void)adDidPresentFullScreenContent:(nonnull id<GADFullScreenPresentingAd>)ad NS_UNAVAILABLE;
64
65 @end
66
67
68 @interface WAAdMobProxy : NSObject
69
70 // 广告测试模式,会强制使用测试广告id
71 + (void)setTestMode:(BOOL)isDebugMode;
72
73
74 /**
75   横幅广告
76   @param viewController 用于显示广告的视图控制器。
77   @param containerView 将包含横幅广告的视图。广告视图将作为此视图的子视图添加。
78  */
79 + (void)bindBannerAdWithViewController:(UIViewController *)viewController containerView:(UIView *)containerView;
80
81
82 // 插页广告
83 + (BOOL)checkInterstitialAdReady;
84 + (void)showInterstitialAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
85
86
87 //开屏广告
88 + (BOOL)checkAppOpenAdReady;
89 + (void)showAppOpenAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
90
91
92 /**
93  显示激励广告。
94
95  此方法在给定的视图控制器上显示激励广告,并处理广告的回调。
96
97  @param viewController 用于显示广告的视图控制器。
98  @param adName 广告名称或广告单元 ID。
99  @param extInfo 额外信息,可以用于调试或跟踪广告。
100  @param delegate 广告展示和关闭时的回调。
101  */
102 + (void)showRewardedAdWithViewController:(UIViewController *)viewController adName:(NSString *)adName extInfo:(NSString *)extInfo delegate:( id<GADFullScreenContentDelegate>)delegate;
103
104
105
106
107 //admob的ump隐私
108
109 + (BOOL)checkUmpOptions;
110 + (void)showUmpOptionsWithViewController:(UIViewController *)viewController consentGatheringComplete:(void (^)(NSError *_Nullable error))completionHandler;
111
112
113
114
115
116
117
118 @end
119
120 NS_ASSUME_NONNULL_END