lpw
2021-01-26 207fead0b75994b11c48c185a703f07220c3a2ee
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
/*
 * CHBAd.h
 * Chartboost
 *
 * Copyright 2019 Chartboost. All rights reserved.
 */
 
#import <UIKit/UIKit.h>
#import "ChartboostDelegate.h"
 
@protocol CHBAdDelegate;
 
NS_ASSUME_NONNULL_BEGIN
 
/*!
 @protocol CHBAd
 @brief The protocol to which all Chartboost ads conform to.
 @discussion Provides an interface for basic functionalities common to all ads.
 */
@protocol CHBAd <NSObject>
 
/*!
 @brief The delegate instance to receive ad callbacks.
 */
@property (nonatomic, weak, nullable) id<CHBAdDelegate> delegate;
 
/*!
 @brief Chartboost location for the ad.
 @discussion Used to obtain ads with increased performance.
 */
@property (nonatomic, readonly) CBLocation location;
 
/*!
 @brief Determines if a cached ad exists.
 @return YES if there is a cached ad, and NO if not.
 */
@property (nonatomic, readonly) BOOL isCached;
 
/*!
 @brief Caches an ad.
 @discussion This method will first check if there is a cached ad and, if found, will do nothing.
 If no cached ad exists the method will attempt to fetch it from the Chartboost server.
 Implement didCacheAd:error: in your ad delegate to be notified of a cache request result.
 */
- (void)cache;
 
/*!
 @brief Shows an ad.
 @param viewController The view controller to present the ad on.
 @discussion This method will first check if there is a cached ad, if found it will present it.
 It is highly recommended that a non-nil view controller is passed, as it is required for enhanced ad presentation and some features like opening links in an in-app web browser.
 */
- (void)showFromViewController:(nullable UIViewController *)viewController;
 
@end
 
NS_ASSUME_NONNULL_END