lpw
2021-08-10 0dfc8c6df759f542ef6e9472430b26ceb0fea867
commit | author | age
45b3f1 1 //
H 2 //  WAAdProxy.h
3 //  WASdkIntfUI
4 //
5 //  Created by hank on 2017/8/15.
6 //  Copyright © 2017年 GHW-T-01. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <UIKit/UIKit.h>
11
12 typedef NS_ENUM(NSInteger, WAAdCancelType) {
13     WAAdCancelTypePlayBefore = 0, // 播放前取消(播放前提示页面)
14     WAAdCancelTypePlaying,        // 播放过程中取消
15     WAAdCancelTypePlayAfter,      // 播放后取消(下载页面取消)
16 };
17
18 /** 广告激励视频代理 */
19 @protocol WAAdRewardedVideoDelegate <NSObject>
20
21 /*!
22  @abstract 显示视频前页面成功时回调
23  @param campaignId 活动Id
24  @param adSetId 广告Id
25  @param rewarded 奖励物品
26  @param rewardedCount 奖励物品数量
27  @param extInfo CP扩展字段
28  */
29 - (void) adPreDisplayRewardedVideoWithCampaignId:(NSString *)campaignId
30                                            adSetId:(NSString *)adSetId
31                                           rewarded:(NSString *)rewarded
32                                      rewardedCount:(NSInteger)rewardedCount
33                                            extInfo:(NSString *)extInfo;
34
35 /*!
36  @abstract 点击叉按钮后回调
37  @param campaignId 活动Id
38  @param adSetId 广告Id
39  @param process WAAdCancelTypePlayBefore 播放前取消,WAAdCancelTypePlaying 播放过程中取消, WAAdCancelTypeAfter 播放后取消(下载页面取消)
40  @param extInfo CP扩展字段
41  */
42 - (void) adDidCancelRewardedVideoWithCampaignId:(NSString *)campaignId
43                                        adSetId:(NSString *)adSetId
44                                        process:(WAAdCancelType)process
45                                        extInfo:(NSString *)extInfo;
46
47 /*!
48  @abstract 加载视频失败回调
49  @param campaignId 活动Id
50  @param adSetId 广告Id
51  @param extInfo CP扩展字段
52  */
53 - (void) adDidFailToLoadRewardedVideoWithCampaignId:(NSString *)campaignId
54                                            adSetId:(NSString *)adSetId
55                                            extInfo:(NSString *)extInfo;
56
57 /*!
58  @abstract 播放视频结束回调
59  @param campaignId 活动Id
60  @param adSetId 广告Id
61  @param rewarded 奖励物品
62  @param rewardedCount 奖励物品数量
63  @param extInfo CP扩展字段
64  */
65 - (void) adDidDisplayRewardedVideoWithCampaignId:(NSString *)campaignId
66                                         adSetId:(NSString *)adSetId
67                                        rewarded:(NSString *)rewarded
68                                   rewardedCount:(NSInteger)rewardedCount
69                                         extInfo:(NSString *)extInfo;
70
71 /*!
72  @abstract 播放完视频点击回调
73  @param campaignId 活动Id
74  @param adSetId 广告Id
75  @param rewarded 奖励物品
76  @param rewardedCount 奖励物品数量
77  @param extInfo CP扩展字段
78  */
79 - (void) adDidClickRewardedVideoWithCampaignId:(NSString *)campaignId
80                                       adSetId:(NSString *)adSetId
81                                      rewarded:(NSString *)rewarded
82                                 rewardedCount:(NSInteger)rewardedCount
83                                       extInfo:(NSString *)extInfo;
84
85 @end
86
87 /** 视频广告缓存完代理 */
88 @protocol WAAdRewardedVideoCachedDelegate <NSObject>
89
90 /*!
91  @abstract 视频广告缓存完成回调
92  @param cacheCount 可用广告数量
93  */
94 - (void)adDidRewardedVideoCachedWithCacheCount:(NSInteger)cacheCount;
95
96 @end
97
98 @interface WAAdProxy : NSObject
99
100 /** 加载广告 */
101 + (void)loadAd;
102
103 /*!
104  @abstract 设置视频广告缓存完回调
105  @param delegate WAAdRewardedVideoCachedDelegate代理
106  */
107 + (void)setWAAdRewardedVideoCachedDelegate:(id<WAAdRewardedVideoCachedDelegate>)delegate;
108
109 /*!
110  @abstract 检测可播放广告数量
111  */
112 + (NSInteger) checkRewardedVideo;
113
114 /*!
115  @abstract 显示广告
116  @param extInfo CP扩展字段
117  @param delegate WAAdRewardedVideoDelegate代理
118  */
119 + (void) displayRewardedVideoWithExtInfo:(NSString *)extInfo delegate:(id<WAAdRewardedVideoDelegate>)delegate;
120
121 @end