-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaxAdController.h
88 lines (66 loc) · 2.53 KB
/
MaxAdController.h
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
//
// MaxAdController.h
// AdsAndPurchase
//
// Created by arthurxu on 2022/6/24.
//
#ifndef MaxAdController_h
#define MaxAdController_h
#import <UIKit/UIKit.h>
#import <AppLovinSDK/AppLovinSDK.h>
#import "AdInfoManager.h"
// 广告加载回调方法:1-succeed:YES-成功 NO-失败 2-error: 信息错误 3-adIndex: 返回加载成功的广告索引下标(分层广告数组才有)
//typedef void (^AdLoadedHandler)(BOOL succeed, NSError * _Nullable error, int adIndex);
// 广告缓存默认过期时间
//static NSInteger const kAdCacheDefaultExpiredTime = 3600;
//
//// 广告加载状态
//typedef enum AdLoadStatus{
// AdLoadStatusFailed = -1,
// AdLoadStatusLoading = 0,
// AdLoadStatusLoaded = 1
//}AdLoadStatus;
//
//// 广告展示状态
//typedef enum AdShowStatus{
// AdShowStatusNoShow = 0, // 未展示
// AdShowStatusShown = 1 // 已展示
//}AdShowStatus;
//
@protocol MaxAdControllerDelegate <NSObject>
@optional
- (void)loadAdWithSlotId: (nonnull NSString*)slotId;
- (void)showAd;
- (BOOL)showAdWithSlotId: (nonnull NSString*)slotId;
@end
@interface MaxAdController : UIViewController<MAAdDelegate>
{
// 广告加载重试次数
NSInteger retryAttempt;
NSMutableDictionary *adDicts;
}
// 广告缓存过期时间(单位:秒)
@property (nonatomic, assign) NSUInteger expiredTime;
@property (nonatomic, strong) id<MaxAdControllerDelegate> _Nullable delegate;
//
//// 通用方法
//-(NSMutableDictionary* _Nullable)adInfo: (nonnull id)ad;
//-(id _Nullable)ad:(nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
//
//-(void)setAdLoadStatus: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId status:(AdLoadStatus)status;
//-(AdLoadStatus)adLoadStatus: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
//
//-(void)setAdLoadTime: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
//-(double)adLoadTime: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
//
//-(void)setAdShowStatus: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId status:(AdShowStatus)status;
//-(AdShowStatus)adShownStatus: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
//
//-(BOOL)adValidated: (nonnull NSMutableDictionary*)dict slotID: (nonnull NSString*)slotId;
// 插屏广告
- (void)loadAdWithSlotId: (nonnull NSString*)slotId;
- (void)loadAdWithSlotIds: (nonnull NSArray*)slotIds;
- (void)showAd;
- (void)removeAdWithSlotId: (nonnull NSString*)slotId;
@end
#endif /* MaxAdController_h */