lpw
6 hours ago bdfd7f6dba1f69e912933e3397ac211be76039b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//
//  WAIAdmob.h
//  WASdkIntf
//
//  Created by lpw on 2024/5/28.
//  Copyright © 2024 GHW-T-01. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <WASdkIntf/WAAdMobProxy.h>
NS_ASSUME_NONNULL_BEGIN
 
@interface WAIAdmob : NSObject
// 广告测试模式,会强制使用测试广告id
- (void)setTestMode:(BOOL)isDebugMode;
 
 
 
//  横幅有关
/**
 * 是否开启横幅广告
 * @return YES表示开启,NO表示关闭
 */
- (BOOL)isOpenBannerAd;
 
/**
 * 异步检查是否开启横幅广告
 * @param completion 回调 block,返回广告启用状态和可能的错误
 */
-  (void)isOpenBannerAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
 
 
 
 
/**
 * 检测横幅广告是非已缓存好
 * @return YES表示广告已准备好,NO表示未准备好
 */
- (BOOL)checkBannerAdReady;
 
 
 
 
 
 
 
/**
  @param viewController 用于显示广告的视图控制器。
  @param containerView 将包含横幅广告的视图。广告视图将作为此视图的子视图添加。
 */
- (void)bindBannerAdWithViewController:(UIViewController *)viewController containerView:(UIView *)containerView ;
 
 
 
 
 
 
 
 
// 插页广告
 
 
/**
 * 是否开启插页广告
 * @return YES表示开启,NO表示关闭
 */
- (BOOL)isOpenInterstitialAd;
 
 
/**
 * 异步检查是否开启插页广告
 * @param completion 回调 block,返回广告启用状态和可能的错误
 */
-  (void)isOpenInterstitialAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
 
 
/**
 * 检测插页广告是非已缓存好
 * @return YES表示广告已准备好,NO表示未准备好
 */
- (BOOL)checkInterstitialAdReady;
- (void)showInterstitialAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
 
 
//开屏广告
 
 
/**
 * 是否开启开屏广告
 * @return YES表示开启,NO表示关闭
 */
- (BOOL)isOpenAppOpenAd;
 
 
 
/**
 * 异步检查是否开启开屏广告
 * @param completion 回调 block,返回广告启用状态和可能的错误
 */
-  (void)isOpenAppOpenAdWithCompletion:(void(^)(BOOL isOpen, NSError *error))completion;
 
 
 
/**
 * 检测开屏广告是非已缓存好
 * @return YES表示广告已准备好,NO表示未准备好
 */
- (BOOL)checkAppOpenAdReady;
- (void)showAppOpenAdWithViewController:(UIViewController *)viewController withDelegate:( id<GADFullScreenContentDelegate>)delegate;
 
 
 
 
/**
 * 是否开启激励广告
 * @return YES表示开启,NO表示关闭
 */
- (BOOL)isOpenRewardedWithAdName:(NSString *)adName;
 
/**
 * 异步检查指定名称的激励视频广告是否可用
 * @param adName 广告名称
 * @param completion 回调 block,返回广告可用性状态和可能的错误
 */
- (void)isOpenRewardedWithAdName:(NSString *)adName
                      completion:(void(^)(BOOL isOpen, NSError *error))completion;
 
 
 
 
/**
 * 检测激励广告是非已缓存好
 * @return YES表示广告已准备好,NO表示未准备好
 */
 
- (BOOL)checkRewardedAdReady;
 
 
/**
 显示激励广告。
 
 此方法在给定的视图控制器上显示激励广告,并处理广告的回调。
 
 @param viewController 用于显示广告的视图控制器。
 @param adName 广告名称或广告单元 ID。
 @param extInfo 额外信息,可以用于调试或跟踪广告。
 @param delegate 广告展示和关闭时的回调。
 */
- (void)showRewardedAdWithViewController:(UIViewController *)viewController adName:(NSString *)adName extInfo:(NSString *)extInfo delegate:( id<GADFullScreenContentDelegate>)delegate;
 
 
 
 
//admob的ump隐私
 
- (BOOL)checkUmpOptions;
- (void)showUmpOptionsWithViewController:(UIViewController *)viewController consentGatheringComplete: (void (^)(NSError *_Nullable error))completionHandler;
 
 
 
/**
 * 获取推广任务列表
 * @param completion 完成回调,返回任务列表数组或错误信息
 * 数组元素格式为:
 * @{
 *   @"taskName": @"任务名称",
 *   @"taskStatus": @"0/1" // 0表示未完成,1表示已完成
 * }
 */
- (void)fetchPromotionTasksWithCompletion:(void(^)(NSArray<NSDictionary *> * _Nullable tasks, NSError * _Nullable error))completion;
 
@end
 
NS_ASSUME_NONNULL_END