Skip to content

Commit 7c8e3ae

Browse files
committed
SDK更新 :2.0.0
1 parent 752a4c4 commit 7c8e3ae

File tree

11 files changed

+322
-307
lines changed

11 files changed

+322
-307
lines changed

OneWaySDK/OWAdsBase.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// OWAdsBase.h
3+
// OneWaySDK
4+
//
5+
// Created by lch on 2017/12/5.
6+
// Copyright © 2017年 mobi.oneway. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
typedef NS_ENUM(NSInteger, OneWaySDKAdType) {
12+
kOneWaySDKAdTypeUnknow = 0,
13+
kOneWaySDKAdTypeRewarded,
14+
kOneWaySDKAdTypeFeed,
15+
kOneWaySDKAdTypeInterstitial,
16+
kOneWaySDKAdTypeBanner
17+
};
18+
19+
typedef NS_ENUM(NSInteger, OneWaySDKPlacementState) {
20+
kOneWaySDKPlacementStateReady,
21+
kOneWaySDKPlacementStateNotAvailable,
22+
kOneWaySDKPlacementStateDisabled,
23+
kOneWaySDKPlacementStateWaiting,
24+
kOneWaySDKPlacementStateNoFill
25+
};
26+
27+
typedef NS_ENUM(NSInteger, OneWaySDKError) {
28+
kOneWaySDKErrorNotInitialized = 0,
29+
kOneWaySDKErrorInitializedFailed,
30+
kOneWaySDKErrorInvalidArgument,
31+
kOneWaySDKErrorVideoPlayerError,
32+
kOneWaySDKErrorInitSanityCheckFail,
33+
kOneWaySDKErrorAdBlockerDetected,
34+
kOneWaySDKErrorFileIoError,
35+
kOneWaySDKErrorDeviceIdError,
36+
kOneWaySDKErrorShowError,
37+
kOneWaySDKErrorInternalError,
38+
kOneWaySDKCampaignNoFill,
39+
};
40+
41+
42+
@interface OWAdsBase : NSObject
43+
- (instancetype)init NS_UNAVAILABLE;
44+
+ (instancetype)initialize NS_UNAVAILABLE;
45+
46+
47+
48+
+ (void)initWithDelegate:(id)delegate type:(OneWaySDKAdType)type;
49+
50+
+ (void)show:(UIViewController *)viewController adType:(OneWaySDKAdType)adType fullScreen:(BOOL)isFullScreen tag:(NSString *)tag;
51+
52+
+ (BOOL)isReady:(OneWaySDKAdType)adType;
53+
54+
+ (void)receivedMessage:(NSString *)message placement:(NSString *)placement errorEvent:(NSString *)errorString;
55+
56+
+ (void)resendRequest ;
57+
58+
+ (void)handle:(id)delegate error:(OneWaySDKError)errorCode message:(NSString *)message;
59+
@end

OneWaySDK/OWInterstitialAd.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// OWIntestitialAd.h
3+
// OneWaySDK
4+
//
5+
// Created by lch on 2017/11/30.
6+
// Copyright © 2017年 mobi.oneway. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "OWAdsBase.h"
11+
@protocol oneWaySDKInterstitialAdDelegate <NSObject>
12+
13+
- (void)oneWaySDKInterstitialAdReady;
14+
15+
- (void)oneWaySDKInterstitialAdDidShow:(NSString *)tag;
16+
17+
- (void)oneWaySDKInterstitialAdDidClose:(NSString *)tag withState:(NSNumber *)state;
18+
19+
- (void)oneWaySDKInterstitialAdDidClick:(NSString *)tag;
20+
21+
- (void)oneWaySDKDidError:(OneWaySDKError)error withMessage:(NSString *)message;
22+
23+
@end
24+
25+
@interface OWInterstitialAd : OWAdsBase
26+
- (instancetype)init NS_UNAVAILABLE;
27+
+ (instancetype)initialize NS_UNAVAILABLE;
28+
+ (void)initWithDelegate:(id)delegate type:(OneWaySDKAdType)type NS_UNAVAILABLE;
29+
+ (void)show:(UIViewController *)viewController adType:(OneWaySDKAdType)adType fullScreen:(BOOL)isFullScreen tag:(NSString *)tag NS_UNAVAILABLE;
30+
+ (BOOL)isReady:(OneWaySDKAdType)adType NS_UNAVAILABLE;
31+
/**
32+
初始化广告位
33+
34+
@param delegate 接收广告回调的代理
35+
*/
36+
+ (void)initWithDelegate:(id<oneWaySDKInterstitialAdDelegate>)delegate;
37+
38+
/**
39+
用于判断广告是否已经准备好
40+
41+
@return 广告是否已经准备好
42+
*/
43+
+ (BOOL)isReady;
44+
45+
/**
46+
使用默认的配置播放广告
47+
48+
@param viewController 需要展示广告的的viewController.
49+
*/
50+
+ (void)show:(UIViewController *)viewController;
51+
52+
/**
53+
自定义show接口,用于配置相关自定义参数.
54+
55+
@param viewController 需要展示广告的的viewController.
56+
@param isFullScreen 广告是否全屏样式.
57+
@param tag 自定义tag,回调时传给开发者,用于优化广告点击.
58+
*/
59+
+ (void)show:(UIViewController *)viewController fullScreen:(BOOL)isFullScreen tag:(NSString *)tag;
60+
61+
62+
@end

OneWaySDK/OWRewardedAd.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// OWRewardedAd.h
3+
// OneWaySDK
4+
//
5+
// Created by lch on 2017/11/30.
6+
// Copyright © 2017年 mobi.oneway. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "OWAdsBase.h"
11+
12+
@protocol oneWaySDKRewardedAdDelegate <NSObject>
13+
14+
- (void)oneWaySDKRewardedAdReady;
15+
16+
- (void)oneWaySDKRewardedAdDidShow:(NSString *)tag;
17+
18+
- (void)oneWaySDKRewardedAdDidClose:(NSString *)tag withState:(NSNumber *)state;
19+
20+
- (void)oneWaySDKRewardedAdDidClick:(NSString *)tag;
21+
22+
- (void)oneWaySDKDidError:(OneWaySDKError)error withMessage:(NSString *)message;
23+
24+
@end
25+
26+
27+
@interface OWRewardedAd : OWAdsBase
28+
29+
+ (void)show:(UIViewController *)viewController adType:(OneWaySDKAdType)adType fullScreen:(BOOL)isFullScreen tag:(NSString *)tag NS_UNAVAILABLE;
30+
+ (void)initWithDelegate:(id)delegate type:(OneWaySDKAdType)type NS_UNAVAILABLE;
31+
+ (BOOL)isReady:(OneWaySDKAdType)adType NS_UNAVAILABLE;
32+
33+
/**
34+
初始化广告位
35+
36+
@param delegate 接收广告回调的代理
37+
*/
38+
+ (void)initWithDelegate:(id<oneWaySDKRewardedAdDelegate>)delegate;
39+
40+
/**
41+
用于判断广告是否已经准备好
42+
43+
@return 广告是否已经准备好
44+
*/
45+
+ (BOOL)isReady;
46+
47+
/**
48+
使用默认的配置播放广告
49+
50+
@param viewController 需要展示广告的的viewController.
51+
*/
52+
+ (void)show:(UIViewController *)viewController;
53+
54+
/**
55+
自定义show接口,用于配置相关自定义参数.
56+
57+
@param viewController 需要展示广告的的viewController.
58+
@param isFullScreen 广告是否全屏样式.
59+
@param tag 自定义tag,回调时传给开发者,用于优化广告点击.
60+
*/
61+
+ (void)show:(UIViewController *)viewController tag:(NSString *)tag;
62+
@end

0 commit comments

Comments
 (0)