Commit d84c010a by 刘卓鑫

修复线上bug 优化广告展示

parent 2ceb1e20
......@@ -7,64 +7,80 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "36CFEDDB-7E88-440D-B5F6-D0CB311424F4"
uuid = "B7FD2D27-E0AA-44DB-B7D3-DDA090EDA1DF"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Task(&#x4efb;&#x52a1;)/ZXTaskViewController.m"
filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "127"
endingLineNumber = "127"
landmarkName = "+showCustomMsg:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4FA80077-F8DB-4F6C-BFF3-A517F50085C1"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "897"
endingLineNumber = "897"
landmarkName = "-nativeExpressBannerAdView:didLoadFailWithError:"
startingLineNumber = "848"
endingLineNumber = "848"
landmarkName = "+requestDataWithType:url:para:completed:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "048BB16C-6B00-4742-9AE4-F9E893AD5D72"
uuid = "17CFB6A3-490C-4973-8493-478F4858F05B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Task(&#x4efb;&#x52a1;)/ZXTaskViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "915"
endingLineNumber = "915"
landmarkName = "-nativeExpressBannerAdViewRenderFail:error:"
startingLineNumber = "1231"
endingLineNumber = "1231"
landmarkName = "-unifiedInterstitialAdViewDidDismissVideoVC:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B7FD2D27-E0AA-44DB-B7D3-DDA090EDA1DF"
uuid = "00B8826C-F8BE-4788-99E0-056327F80256"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m"
filePath = "ColorfulSchool/Classes/Task(&#x4efb;&#x52a1;)/ZXTaskViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "127"
endingLineNumber = "127"
landmarkName = "+showCustomMsg:"
startingLineNumber = "687"
endingLineNumber = "687"
landmarkName = "-nativeExpresInterstitialAd:didFailWithError:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "4FA80077-F8DB-4F6C-BFF3-A517F50085C1"
uuid = "79B52365-518B-4FC9-BCB7-64D2BCD2A0C7"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m"
filePath = "ColorfulSchool/Classes/Task(&#x4efb;&#x52a1;)/ZXTaskViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "848"
endingLineNumber = "848"
landmarkName = "+requestDataWithType:url:para:completed:"
startingLineNumber = "616"
endingLineNumber = "616"
landmarkName = "-nativeExpressRewardedVideoAd:didFailWithError:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
......
//
//
......@@ -97,9 +97,16 @@
field.placeholder = @"请输入设备地址搜索";
__weak typeof(field) weakField = field;
[field.rac_textSignal subscribeNext:^(NSString *x){
@strongify(self);
if (x.length > 30) {
enlargeClickRegionBtn *searchBtn = [[enlargeClickRegionBtn alloc] init];
[holderView addSubview:searchBtn];
[searchBtn setBackgroundImage:[UIImage imageNamed:@"btn_Select-search"] forState:UIControlStateNormal];
[searchBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(holderView.mas_right).offset(-5 * k6Scale);
make.centerY.equalTo(holderView.mas_centerY);
}];
[[searchBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
if (weakField.text.length > 30) {
[ZXTool showText:@"输入地址长度不能超过30!"];
weakField.text = [x substringToIndex:30];
return ;
......@@ -111,21 +118,13 @@
return ;
}
//这里触发检索
NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"fd_location LIKE[cd] '*%@*'", x]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"name LIKE[cd] '*%@*'", weakField.text]];
NSArray *results = [self.washService.allMerthinList filteredArrayUsingPredicate:predicate];
[self.dataArray removeAllObjects];
[self.dataArray addObjectsFromArray:results];
[self.myTableview reloadData];
}];
enlargeClickRegionBtn *searchBtn = [[enlargeClickRegionBtn alloc] init];
[holderView addSubview:searchBtn];
[searchBtn setBackgroundImage:[UIImage imageNamed:@"btn_Select-search"] forState:UIControlStateNormal];
[searchBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(holderView.mas_right).offset(-5 * k6Scale);
make.centerY.equalTo(holderView.mas_centerY);
}];
UIView *line = [UIView new];
[contentView addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
......
//
//
......@@ -212,9 +212,8 @@
vc.scanResult = ^(NSString *result) {
@strongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[self jumpWashWithMerthinCode:[ZXTool dencode:result]];
[self jumpWashWithMerthinCode:result];
});
};
[self.navigationController pushViewController:vc animated:NO];
}];
......@@ -327,7 +326,7 @@
make.height.mas_equalTo(25 * k6Scale);
}];
field.clearButtonMode = UITextFieldViewModeWhileEditing;
field.keyboardType = UIKeyboardTypeNumberPad;
field.keyboardType = UIKeyboardTypeURL;
UIImage *i = [UIImage imageNamed:@"btn_search"];
UIButton *searchBtn = [[UIButton alloc] init];
......@@ -350,20 +349,15 @@
make.left.equalTo(textBg.mas_left);
}];
__weak typeof(field) weakField = field;
[field.rac_textSignal subscribeNext:^(NSString *x){
if (x.length > 6) {
[ZXTool showText:@"输入设备编码长度不能超过6!"];
weakField.text = [x substringToIndex:6];
return ;
}
}];
@weakify(self);
__weak typeof(field) weakField = field;
[[searchBtn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(NSString *x) {
@strongify(self);
[[UIApplication sharedApplication].keyWindow endEditing:YES];
if ([weakField.text isEqualToString:@""] || weakField.text.length != 6) {
if ([weakField.text isEqualToString:@""]) {
ShowMsgView *show = [[ShowMsgView alloc] initWithFrame:[UIScreen mainScreen].bounds msg:@"请输入正确的设备编码"];
[show show];
} else {
......
//
//
......@@ -148,7 +148,7 @@
return ;
}
//这里触发检索
NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"fd_location LIKE[cd] '*%@*'", x]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"name LIKE[cd] '*%@*'", x]];
NSArray *results = [self.washService.allMerthinList filteredArrayUsingPredicate:predicate];
[self.dataArray removeAllObjects];
[self.dataArray addObjectsFromArray:results];
......
//
//
......@@ -96,7 +96,10 @@
[self addBannerAd];//添加广告
[self preloadCSJRewardAd];
[self preloadFullScreenVideo];
[ZXTool showLoadingAnimation];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
});
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
......@@ -312,7 +315,7 @@
[ZXTaskManager sharedZXTaskManager].taskCode = arr[2];
[ZXTaskManager sharedZXTaskManager].isTaskCompleted = (taskType == 3);
switch (taskType) {
case 1: {//激励视频
case 1: {//
NSInteger adType = [arr[5] integerValue]; //3插屏广告 4 全屏视频广告 5激励视频
[self taskAdWithAdvertType:adType];
......@@ -588,7 +591,6 @@
[self.rewardedAd loadAdData];
//为保证播放流畅和展示流畅建议可在收到渲染成功和视频下载完成回调后再展示视频。
});
}
#pragma mark - ===================显示穿山甲激励视频==================
......@@ -596,22 +598,26 @@
if (self.rewardedAd.isAdValid) {
[self.rewardedAd showAdFromRootViewController:self.navigationController];
} else {
[self.rewardedAd loadAdData];
[ZXTool showText:@"激励视频广告加载失败,请切换网络环境或请稍后再试"];
}
}
#pragma mark - BUNativeExpressRewardedVideoAdDelegate
- (void)nativeExpressRewardedVideoAdDidLoad:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
//预加载成功
}
- (void)nativeExpressRewardedVideoAd:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error {
//预加载
[self.rewardedAd loadAdData];
//[ZXTool showText:[NSString stringWithFormat:@"material or template plugin load fail %@", error.description]];
}
- (void)nativeExpressRewardedVideoAdDidDownLoadVideo:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
}
- (void)nativeExpressRewardedVideoAdViewRenderSuccess:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
......@@ -619,8 +625,7 @@
}
- (void)nativeExpressRewardedVideoAdViewRenderFail:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error {
//预加载
[self.rewardedAd loadAdData];
//[ZXTool showText:[NSString stringWithFormat:@"material RenderFail %@", error.description]];
}
- (void)nativeExpressRewardedVideoAdWillVisible:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
......@@ -638,7 +643,8 @@
}
- (void)nativeExpressRewardedVideoAdDidClose:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
//预加载
[self.rewardedAd loadAdData];
}
- (void)nativeExpressRewardedVideoAdDidClick:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd {
......@@ -673,23 +679,23 @@
- (void)nativeExpresInterstitialAdDidLoad:(BUNativeExpressInterstitialAd *)interstitialAd {
NSLog(@"%s",__func__);
}
- (void)nativeExpresInterstitialAd:(BUNativeExpressInterstitialAd *)interstitialAd didFailWithError:(NSError *)error {
NSLog(@"%s",__func__);
[ZXTool showText:error.description];
// [ZXTool showText:@"插屏广告加载失败,请切换网络环境或请稍后再试"];
// [self.interstitialAd loadAdData];
}
- (void)nativeExpresInterstitialAdRenderSuccess:(BUNativeExpressInterstitialAd *)interstitialAd {
NSLog(@"%s",__func__);
if (self.interstitialAd.isAdValid) {
[self.interstitialAd showAdFromRootViewController:self];
}
[self.interstitialAd showAdFromRootViewController:self];
}
- (void)nativeExpresInterstitialAdRenderFail:(BUNativeExpressInterstitialAd *)interstitialAd error:(NSError *)error {
NSLog(@"%s",__func__);
// [ZXTool showText:error.description];
}
- (void)nativeExpresInterstitialAdWillVisible:(BUNativeExpressInterstitialAd *)interstitialAd {
......@@ -716,9 +722,13 @@
[self.fullscreenAd loadAdData];
}
- (void) showFullScreenVideo {
if (self.fullscreenAd.isAdValid) {
[self.fullscreenAd showAdFromRootViewController:self.navigationController];
} else {
[self.fullscreenAd loadAdData];
[ZXTool showText:@"全屏视频广告加载失败,请切换网络环境或稍后再试"];
}
}
#pragma mark - BUFullscreenVideoAdDelegate
......@@ -729,22 +739,23 @@
- (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error {
NSLog(@"%s",__func__);
[self.fullscreenAd loadAdData];
//[ZXTool showText:[NSString stringWithFormat:@"BUFullscreen load failure %@", error.description]];
}
- (void)nativeExpressFullscreenVideoAdViewRenderSuccess:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd {
NSLog(@"%s",__func__);
}
- (void)nativeExpressFullscreenVideoAdViewRenderFail:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error {
NSLog(@"%s",__func__);
//[ZXTool showText:[NSString stringWithFormat:@"BUFullscreen RenderFail %@", error.description]];
}
- (void)nativeExpressFullscreenVideoAdDidDownLoadVideo:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd {
NSLog(@"%s",__func__);
}
- (void)nativeExpressFullscreenVideoAdWillVisible:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd {
......@@ -770,8 +781,8 @@
- (void)nativeExpressFullscreenVideoAdDidClose:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd {
NSLog(@"%s",__func__);
//再加载一个
[self.fullscreenAd loadAdData];
}
- (void)nativeExpressFullscreenVideoAdDidPlayFinish:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error {
......@@ -1054,19 +1065,15 @@
}
#pragma mark - ===================腾讯插屏广告===========================
- (void) createTxInterstitialAd {
self.tx_interstitialAd = [[GDTUnifiedInterstitialAd alloc] initWithAppId:kTXAdAPPID placementId:@"7070290218848229"];
self.tx_interstitialAd.delegate = self;
// self.tx_interstitialAd.videoMuted = YES;
// self.tx_interstitialAd.detailPageVideoMuted = YES;
// self.tx_interstitialAd.videoAutoPlayOnWWAN = YES;
// self.tx_interstitialAd.minVideoDuration = 1;
// self.tx_interstitialAd.maxVideoDuration = 30; // 如果需要设置视频最大时长,可以通过这个参数来进行设置
[self.tx_interstitialAd loadAd];
- (GDTUnifiedInterstitialAd *)tx_interstitialAd {
if (!_tx_interstitialAd) {
_tx_interstitialAd = [[GDTUnifiedInterstitialAd alloc] initWithAppId:kTXAdAPPID placementId:@"7070290218848229"];
_tx_interstitialAd.delegate = self;
}
return _tx_interstitialAd;
}
#pragma mark - GDTUnifiedInterstitialAdDelegate
/**
......@@ -1076,7 +1083,7 @@
- (void)unifiedInterstitialSuccessToLoadAd:(GDTUnifiedInterstitialAd *)unifiedInterstitial
{
NSLog(@"%s",__FUNCTION__);
[self.tx_interstitialAd presentAdFromRootViewController:self];
[self.tx_interstitialAd presentAdFromRootViewController:self.tabBarController];
}
/**
......@@ -1122,7 +1129,7 @@
- (void)unifiedInterstitialDidDismissScreen:(GDTUnifiedInterstitialAd *)unifiedInterstitial
{
NSLog(@"%s",__FUNCTION__);
[self taskCompleted];
}
/**
......@@ -1180,7 +1187,7 @@
- (void)unifiedInterstitialAdDidDismissFullScreenModal:(GDTUnifiedInterstitialAd *)unifiedInterstitial
{
NSLog(@"%s",__FUNCTION__);
[self taskCompleted];
}
......
/*
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "Click";
"AD" = "AD";
"PlayConsumed" = "%.2fMB traffic will be consumed if you play it";
"Evaluation" = "Evaluation";
"Score" = "%@ score";
"Select" = "Select";
"Back" = "Back";
"Replay" = "Click to replay";
"Continue" = "Continue to play";
"Skip" = "Skip";
"ViewNow" = "View now";
"Download" = "Download";
"LoadFailure" = "Failed to load, and click to try again";
"GetRewardAfterWatching" = "Get reward after watching the full video";
"GiveUpReward" = "Give up reward";
"ContinueWatching" = "Continue watching";
"CanbeTurnedOffAfter" = "can be turned off after %ds";
"Get" = "Get";
"View" = "View";
// Icon
/*
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "クリック";
"AD" = "広告";
"PlayConsumed" = "再生すると%.2fMBの通信量が消費されます";
"Evaluation" = "評価";
"Score" = "評価数:%@";
"Select" = "選択";
"Back" = "戻る";
"Replay" = "リプレイ";
"Continue" = "再生し続ける";
"Skip" = "skip";
"ViewNow" = "詳細を見る";
"Download" = "download";
"LoadFailure" = "ロードに失敗しました。クリックして再度お試しください";
"GetRewardAfterWatching" = "動画を最後まで視聴いただけるとリワードを付与されます";
"GiveUpReward" = "リワード不要";
"ContinueWatching" = "視聴し続ける";
"CanbeTurnedOffAfter" = "%ds後に閉じられます";
"Get" = "Get";
"View" = "View";
// Icon
/*
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "点击";
"AD" = "广告";
"PlayConsumed" = "播放将消耗%.2fMB流量";
"Evaluation" = "评价";
"Score" = "%@个评分";
"Select" = "选择";
"Back" = "返回";
"Replay" = "点击重播";
"Continue" = "继续播放";
"Skip" = "跳过";
"ViewNow" = "立即查看";
"Download" = "立即下载";
"LoadFailure" = "加载失败,点击重试";
"GetRewardAfterWatching" = "观看完整视频才能获得奖励";
"GiveUpReward" = "放弃奖励";
"ContinueWatching" = "继续观看";
"CanbeTurnedOffAfter" = "%ds后可关闭";
"Get" = "下载";
"View" = "查看";
// Icon
Versions/Current/BUAdSDK
Versions/Current/BUAdSDK
\ No newline at end of file
Versions/Current/Headers
Versions/Current/Headers
\ No newline at end of file
framework module BUAdSDK {
framework module BUAdSDK {
umbrella header "BUAdSDK.h"
export *
module * { export * }
}
Versions/Current/Resources
Versions/Current/Resources
\ No newline at end of file
//
//
// BUAdSDK.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
// In this header, you should import all the public headers of your framework using statements like #import <BUAdSDK/PublicHeader.h>
#import <BUAdSDK/BUAdSDKDefines.h>
#import <BUAdSDK/BUAdSDKManager.h>
#import <BUAdSDK/BUAdSDKError.h>
#import <BUAdSDK/BUAdSlot.h>
#import <BUAdSDK/BUImage.h>
#import <BUAdSDK/BUSize.h>
#import <BUAdSDK/BUMaterialMeta.h>
#import <BUAdSDK/BUPlayerPublicDefine.h>
#import <BUAdSDK/BUVideoAdView.h>
///customize dislike style
#import <BUAdSDK/BUDislike.h>
#import <BUAdSDK/BUDislikeWords.h>
/// native ads
#import <BUAdSDK/BUNativeAd.h>
#import <BUAdSDK/BUNativeAdRelatedView.h>
#import <BUAdSDK/BUNativeAdsManager.h>
/// native express ads
#import <BUAdSDK/BUNativeExpressAdManager.h>
#import <BUAdSDK/BUNativeExpressAdView.h>
#import <BUAdSDK/BUNativeExpressBannerView.h>
#import <BUAdSDK/BUNativeExpressInterstitialAd.h>
#import <BUAdSDK/BUNativeExpressRewardedVideoAd.h>
#import <BUAdSDK/BUNativeExpressFullscreenVideoAd.h>
/// banner ads
#import <BUAdSDK/BUBannerAdView.h>
/// splash ads
#import <BUAdSDK/BUSplashAdView.h>
/// interstitial ads
#import <BUAdSDK/BUInterstitialAd.h>
/// rewarded video ads
#import <BUAdSDK/BURewardedVideoModel.h>
#import <BUAdSDK/BURewardedVideoAd.h>
/// full-screen video ads
#import <BUAdSDK/BUFullscreenVideoAd.h>
/// playable tool
#import <BUAdSDK/BUAdSDKPlayableToolManager.h>
//
//
// BUAdSDKDefines.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#ifndef BUAdSDK_DEFINES_h
#define BUAdSDK_DEFINES_h
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, BUUserGender) {
BUUserGenderUnknown,
BUUserGenderMan,
BUUserGenderWoman,
};
typedef NS_ENUM(NSInteger, BUAdSDKLogLevel) {
BUAdSDKLogLevelNone,
BUAdSDKLogLevelError,
BUAdSDKLogLevelDebug
};
typedef NS_ENUM(NSInteger, BURitSceneType) {
BURitSceneType_custom = 0,//custom
BURitSceneType_home_open_bonus = 1,//Login/open rewards (login, sign-in, offline rewards doubling, etc.)
BURitSceneType_home_svip_bonus = 2,//Special privileges (VIP privileges, daily rewards, etc.)
BURitSceneType_home_get_props = 3,//Watch rewarded video ad to gain skin, props, levels, skills, etc
BURitSceneType_home_try_props = 4,//Watch rewarded video ad to try out skins, props, levels, skills, etc
BURitSceneType_home_get_bonus = 5,//Watch rewarded video ad to get gold COINS, diamonds, etc
BURitSceneType_home_gift_bonus = 6,//Sweepstakes, turntables, gift boxes, etc
BURitSceneType_game_start_bonus = 7,//Before the opening to obtain physical strength, opening to strengthen, opening buff, task props
BURitSceneType_game_reduce_waiting = 8,//Reduce wait and cooldown on skill CD, building CD, quest CD, etc
BURitSceneType_game_more_opportunities = 9,//More chances (resurrect death, extra game time, decrypt tips, etc.)
BURitSceneType_game_finish_rewards = 10,//Settlement multiple times/extra bonus (completion of chapter, victory over boss, first place, etc.)
BURitSceneType_game_gift_bonus = 11//The game dropped treasure box, treasures and so on
};
@protocol BUToDictionary <NSObject>
- (NSDictionary *)dictionaryValue;
@end
#endif
//
//
// BUAdSDKError.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSErrorDomain BUErrorDomain ;
typedef NS_ENUM(NSInteger, BUErrorCode) {
BUErrorCodeTempError = -6, // native template is invalid
BUErrorCodeTempAddationError= -5, // native template addation is invalid
BUErrorCodeOpenAPPStoreFail = -4, // failed to open appstore
BUErrorCodeNOAdError = -3, // parsed data has no ads
BUErrorCodeNetError = -2, // network request failed
BUErrorCodeParseError = -1, // parsing failed
BUErrorCodePlayableError_ERR_HAS_CACHE = -702, // has cache
BUErrorCodePlayableError_ERR_UNZIP = -704, // unzip error
BUErrorCodeNERenderResultError= 101, // native Express ad, render result parse fail
BUErrorCodeNETempError = 102, // native Express ad, template is invalid
BUErrorCodeNETempPluginError = 103, // native Express ad, template plugin is invalid
BUErrorCodeNEDataError = 104, // native Express ad, data is invalid
BUErrorCodeNEParseError = 105, // native Express ad, parse fail
BUErrorCodeNERenderError = 106, // native Express ad, render fail
BUErrorCodeNERenderTimoutError= 107, // native Express ad, render timeout
BUErrorCodeSDKStop = 1000, // SDK stop forcely
BUErrorCodeParamError = 10001, // parameter error
BUErrorCodeTimeout = 10002,
BUErrorCodeSuccess = 20000,
BUErrorCodeNOAD = 20001, // no ads
BUErrorCodeContentType = 40000, // http conent_type error
BUErrorCodeRequestPBError = 40001, // http request pb error
BUErrorCodeAppEmpty = 40002, // request app can't be empty
BUErrorCodeWapEMpty = 40003, // request wap can't be empty
BUErrorCodeAdSlotEmpty = 40004, // missing ad slot description
BUErrorCodeAdSlotSizeEmpty = 40005, // the ad slot size is invalid
BUErrorCodeAdSlotIDError = 40006, // the ad slot ID is invalid
BUErrorCodeAdCountError = 40007, // request the wrong number of ads
BUUnionAdImageSizeError = 40008, // wrong image size
BUUnionAdSiteIdError = 40009, // Media ID is illegal
BUUnionAdSiteMeiaTypeError = 40010, // Media type is illegal
BUUnionAdSiteAdTypeError = 40011, // Ad type is illegal
BUUnionAdSiteAccessMethodError = 40012,// Media access type is illegal and has been deprecated
BUUnionSplashAdTypeError = 40013, // Code bit id is less than 900 million, but adType is not splash ad
BUUnionRedirectError = 40014, // The redirect parameter is incorrect
BUUnionRequestInvalidError = 40015, // Media rectification exceeds deadline, request illegal
BUUnionAppSiteRelError = 40016, // The relationship between slot_id and app_id is invalid.
BUUnionAccessMethodError = 40017, // Media access type is not legal API/SDK
BUUnionPackageNameError = 40018, // Media package name is inconsistent with entry
BUUnionConfigurationError = 40019, // Media configuration ad type is inconsistent with request
BUUnionRequestLimitError = 40020, // The ad space registered by developers exceeds daily request limit
BUUnionSignatureError = 40021, // Apk signature sha1 value is inconsistent with media platform entry
BUUnionIncompleteError = 40022, // Whether the media request material is inconsistent with the media platform entry
BUUnionOSError = 40023, // The OS field is incorrectly filled
BUUnionLowVersion = 40024, // The SDK version is too low to return ads
BUErrorCodeAdPackageIncomplete = 40025,// the SDK package is incomplete. It is recommended to verify the integrity of SDK package or contact technical support.
BUUnionMedialCheckError = 40026, // Non-international account request for overseas delivery system
BUErrorCodeSysError = 50001 // ad server error
};
//
//
// BUAdSDKManager.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BUAdSDKDefines.h"
@interface BUAdSDKManager : NSObject
@property (nonatomic, copy, readonly, class) NSString *SDKVersion;
/**
Register the App key that’s already been applied before requesting an ad from TikTok Audience Network.
@param appID : the unique identifier of the App
*/
+ (void)setAppID:(NSString *)appID;
/**
Configure development mode.
@param level : default BUAdSDKLogLevelNone
*/
+ (void)setLoglevel:(BUAdSDKLogLevel)level;
/// Set the gender of the user.
+ (void)setUserGender:(BUUserGender)userGender;
/// Set the age of the user.
+ (void)setUserAge:(NSUInteger)userAge;
/* Set the COPPA of the user, COPPA is the short of Children's Online Privacy Protection Rule, the interface only works in the United States.
* @params Coppa 0 adult, 1 child
*/
+ (void)setCoppa:(NSUInteger)Coppa;
/// Set the user's keywords, such as interests and hobbies, etc.
+ (void)setUserKeywords:(NSString *)keywords;
/// set additional user information.
+ (void)setUserExtData:(NSString *)data;
/// Set whether the app is a paid app, the default is a non-paid app
+ (void)setIsPaidApp:(BOOL)isPaidApp;
+ (NSString *)appID;
+ (BOOL)isPaidApp;
@end
//
//
// BUAdSDKPlayableToolManager.h
// BUAdSDK
//
// Copyright © 2019 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BUAdSDKPlayableToolManager : NSObject
+ (instancetype)sharedInstance;
+ (void)setPlayableURL:(NSString *)url;
+ (void)setDownloadUrl:(NSString *)url;
+ (void)setDeeplinkUrl:(NSString *)url;
+ (void)setIsLandScape:(BOOL)isLandScape;
+ (void)clearAll;
@end
//
//
// BUAdSlot.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BUSize.h"
typedef NS_ENUM(NSInteger, BUAdSlotAdType) {
BUAdSlotAdTypeUnknown = 0,
BUAdSlotAdTypeBanner = 1, // banner ads
BUAdSlotAdTypeInterstitial = 2, // interstitial ads
BUAdSlotAdTypeSplash = 3, // splash ads
BUAdSlotAdTypeSplash_Cache = 4, // cache splash ads
BUAdSlotAdTypeFeed = 5, // feed ads
BUAdSlotAdTypePaster = 6, // paster ads
BUAdSlotAdTypeRewardVideo = 7, // rewarded video ads
BUAdSlotAdTypeFullscreenVideo = 8, // full-screen video ads
BUAdSlotAdTypeDrawVideo = 9, // vertical (immersive) video ads
};
typedef NS_ENUM(NSInteger, BUAdSlotPosition) {
BUAdSlotPositionTop = 1,
BUAdSlotPositionBottom = 2,
BUAdSlotPositionFeed = 3,
BUAdSlotPositionMiddle = 4, // for interstitial ad only
BUAdSlotPositionFullscreen = 5,
};
@interface BUAdSlot : NSObject
/// required. The unique identifier of a native ad.
@property (nonatomic, copy) NSString *ID;
/// required. Ad type.
@property (nonatomic, assign) BUAdSlotAdType AdType;
/// required. Ad display location.
@property (nonatomic, assign) BUAdSlotPosition position;
/// Accept a set of image sizes, please pass in the BUSize object.
@property (nonatomic, strong) NSMutableArray<BUSize *> *imgSizeArray;
/// required. Image size.
@property (nonatomic, strong) BUSize *imgSize;
/// Icon size.
@property (nonatomic, strong) BUSize *iconSize;
/// Maximum length of the title.
@property (nonatomic, assign) NSInteger titleLengthLimit;
/// Maximum length of description.
@property (nonatomic, assign) NSInteger descLengthLimit;
/// Whether to support deeplink.
@property (nonatomic, assign) BOOL isSupportDeepLink;
/// Native banner ads and native interstitial ads are set to 1, other ad types are 0, the default is 0.
@property (nonatomic, assign) BOOL isOriginAd;
- (NSDictionary *)dictionaryValue;
@end
//
//
// BUBannerAdView.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUNativeAd.h"
@class BUDislikeWords, BUAdSlot;
@protocol BUBannerAdViewDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface BUBannerAdView : UIView
@property (nonatomic, weak, nullable) id<BUBannerAdViewDelegate> delegate;
/**
The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
*/
@property (nonatomic, assign, readonly) NSInteger interval;
/**
The dislikeButton has been added to the upper right corner of the BannerView by default, it will respond to dislike reasons.
*/
@property (nonatomic, strong, readonly, nonnull) UIButton *dislikeButton;
- (instancetype)initWithIdentifier:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
adSize:(CGSize)adSize
withShowPosition:(BUAdSlotPosition)showPosition
WithIsSupportDeepLink:(BOOL)isSupportDeepLink;
- (instancetype)initWithIdentifier:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
adSize:(CGSize)adSize
withShowPosition:(BUAdSlotPosition)showPosition
WithIsSupportDeepLink:(BOOL)isSupportDeepLink
interval:(NSInteger)interval;
- (instancetype)initWithSlotID:(NSString *)slotID
size:(BUSize *)adSize
rootViewController:(UIViewController *)rootViewController;
- (instancetype)initWithSlotID:(NSString *)slotID
size:(BUSize *)adSize
rootViewController:(UIViewController *)rootViewController
interval:(NSInteger)interval;
- (void)loadAdData;
- (IBAction)dislikeAction:(id)sender;
@end
@protocol BUBannerAdViewDelegate <NSObject>
@optional
/**
This method is called when bannerAdView ad slot loaded successfully.
@param bannerAdView : view for bannerAdView
@param nativeAd : nativeAd for bannerAdView
*/
- (void)bannerAdViewDidLoad:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when bannerAdView ad slot failed to load.
@param error : the reason of error
*/
- (void)bannerAdView:(BUBannerAdView *)bannerAdView didLoadFailWithError:(NSError *_Nullable)error;
/**
This method is called when bannerAdView ad slot showed new ad.
*/
- (void)bannerAdViewDidBecomVisible:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when bannerAdView is clicked.
*/
- (void)bannerAdViewDidClick:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when the user clicked dislike button and chose dislike reasons.
@param filterwords : the array of reasons for dislike.
*/
- (void)bannerAdView:(BUBannerAdView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterwords;
/**
This method is called when another controller has been closed.
@param interactionType : open appstore in app or open the webpage or view video ad details page.
*/
- (void)bannerAdViewDidCloseOtherController:(BUBannerAdView *)bannerAdView interactionType:(BUInteractionType)interactionType;
@end
NS_ASSUME_NONNULL_END
//
//
// BUDislike.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@class BUNativeAd;
@class BUDislikeWords;
/**
!!! important :
Please report to the sdk the user’s selection, inaccurate model will result in poor ad performance.
*/
@interface BUDislike : NSObject
/**
The array of BUDislikeWords which have reasons for dislike.
The application can show the secondary page for dislike if '[filterWords.options count] > 0'.
*/
@property (nonatomic, copy, readonly) NSArray<BUDislikeWords *> *filterWords;
/**
Initialize with nativeAd to get filterWords.
return BUDislike
*/
- (instancetype)initWithNativeAd:(BUNativeAd *)nativeAd;
/**
Call this method after the user chose dislike reasons.
(Only for object which uses 'BUDislike.filterWords')
@param filterWord : reasons for dislike
@note : don't need to call this method if '[filterWords.options count] > 0'.
@note :please dont't change 'BUDislike.filterWords'.
'filterWord' must be one of 'BUDislike.filterWords', otherwise it will be filtered.
*/
- (void)didSelectedFilterWordWithReason:(BUDislikeWords *)filterWord;
@end
//
//
// BUDislikeWords.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BUDislikeWords : NSObject <NSCoding>
@property (nonatomic, copy, readonly) NSString *dislikeID;
@property (nonatomic, copy, readonly) NSString *name;
@property (nonatomic, assign, readonly) BOOL isSelected;
@property (nonatomic, copy,readonly) NSArray<BUDislikeWords *> *options;
- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)error;
@end
//
//
// BUFullscreenVideoAd.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BUAdSlot.h"
NS_ASSUME_NONNULL_BEGIN
@class BUFullscreenVideoAd;
@protocol BUFullscreenVideoAdDelegate <NSObject>
@optional
/**
This method is called when video ad material loaded successfully.
*/
- (void)fullscreenVideoMaterialMetaAdDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad materia failed to load.
@param error : the reason of error
*/
- (void)fullscreenVideoAd:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when video cached successfully.
*/
- (void)fullscreenVideoAdVideoDataDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot will be showing.
*/
- (void)fullscreenVideoAdWillVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot has been shown.
*/
- (void)fullscreenVideoAdDidVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is clicked.
*/
- (void)fullscreenVideoAdDidClick:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is about to close.
*/
- (void)fullscreenVideoAdWillClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is closed.
*/
- (void)fullscreenVideoAdDidClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad play completed or an error occurred.
@param error : the reason of error
*/
- (void)fullscreenVideoAdDidPlayFinish:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when the user clicked skip button.
*/
- (void)fullscreenVideoAdDidClickSkip:(BUFullscreenVideoAd *)fullscreenVideoAd;
@end
@interface BUFullscreenVideoAd : NSObject
@property (nonatomic, weak, nullable) id<BUFullscreenVideoAdDelegate> delegate;
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
/**
Initializes video ad with slot id.
@param slotID : the unique identifier of video ad.
@return BUFullscreenVideoAd
*/
- (instancetype)initWithSlotID:(NSString *)slotID;
/**
Load video ad datas.
*/
- (void)loadAdData;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@param sceneDescirbe : optional. Identifies a custom description of the presentation scenario.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
@end
NS_ASSUME_NONNULL_END
//
//
// BUImage.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BUImage : NSObject <NSCoding>
// image address URL
@property (nonatomic, copy) NSString *imageURL;
// image width
@property (nonatomic, assign) float width;
// image height
@property (nonatomic, assign) float height;
- (instancetype)initWithDictionary:(NSDictionary *)dic;
- (NSDictionary *)dictionaryValue;
@end
//
//
// BUInterstitialAd.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUAdSDKDefines.h"
#import "BUMaterialMeta.h"
NS_ASSUME_NONNULL_BEGIN
@class BUSize;
@protocol BUInterstitialAdDelegate;
@interface BUInterstitialAd : NSObject
@property (nonatomic, weak, nullable) id<BUInterstitialAdDelegate> delegate;
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
/**
Initializes interstitial ad.
@param slotID : The unique identifier of interstitial ad.
@param expectSize : custom size, default 600px * 400px
@return BUInterstitialAd
*/
- (instancetype)initWithSlotID:(NSString *)slotID size:(BUSize *)expectSize NS_DESIGNATED_INITIALIZER;
/**
Load interstitial ad datas.
*/
- (void)loadAdData;
/**
Display interstitial ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
@end
@protocol BUInterstitialAdDelegate <NSObject>
@optional
/**
This method is called when interstitial ad material loaded successfully.
*/
- (void)interstitialAdDidLoad:(BUInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad material failed to load.
@param error : the reason of error
*/
- (void)interstitialAd:(BUInterstitialAd *)interstitialAd didFailWithError:(NSError * _Nullable)error;
/**
This method is called when interstitial ad slot will be showing.
*/
- (void)interstitialAdWillVisible:(BUInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is clicked.
*/
- (void)interstitialAdDidClick:(BUInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is about to close.
*/
- (void)interstitialAdWillClose:(BUInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is closed.
*/
- (void)interstitialAdDidClose:(BUInterstitialAd *)interstitialAd;
/**
This method is called when another controller has been closed.
@param interactionType : open appstore in app or open the webpage or view video ad details page.
*/
- (void)interstitialAdDidCloseOtherController:(BUInterstitialAd *)interstitialAd interactionType:(BUInteractionType)interactionType;
@end
NS_ASSUME_NONNULL_END
//
//
// BUMaterialMeta.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BUDislikeWords.h"
#import "BUImage.h"
typedef NS_ENUM(NSInteger, BUInteractionType) {
BUInteractionTypeCustorm = 0,
BUInteractionTypeNO_INTERACTION = 1, // pure ad display
BUInteractionTypeURL = 2, // open the webpage using a browser
BUInteractionTypePage = 3, // open the webpage within the app
BUInteractionTypeDownload = 4, // download the app
BUInteractionTypePhone = 5, // make a call
BUInteractionTypeMessage = 6, // send messages
BUInteractionTypeEmail = 7, // send email
BUInteractionTypeVideoAdDetail = 8 // video ad details page
};
typedef NS_ENUM(NSInteger, BUFeedADMode) {
BUFeedADModeSmallImage = 2,
BUFeedADModeLargeImage = 3,
BUFeedADModeGroupImage = 4,
BUFeedVideoAdModeImage = 5, // video ad || rewarded video ad horizontal screen
BUFeedVideoAdModePortrait = 15, // rewarded video ad vertical screen
BUFeedADModeImagePortrait = 16
};
@interface BUMaterialMeta : NSObject <NSCoding>
/// interaction types supported by ads.
@property (nonatomic, assign) BUInteractionType interactionType;
/// material pictures.
@property (nonatomic, strong) NSArray<BUImage *> *imageAry;
/// ad logo icon.
@property (nonatomic, strong) BUImage *icon;
/// ad headline.
@property (nonatomic, copy) NSString *AdTitle;
/// ad description.
@property (nonatomic, copy) NSString *AdDescription;
/// ad source.
@property (nonatomic, copy) NSString *source;
/// text displayed on the creative button.
@property (nonatomic, copy) NSString *buttonText;
/// display format of the in-feed ad, other ads ignores it.
@property (nonatomic, assign) BUFeedADMode imageMode;
/// Star rating, range from 1 to 5.
@property (nonatomic, assign) NSInteger score;
/// Number of comments.
@property (nonatomic, assign) NSInteger commentNum;
/// ad installation package size, unit byte.
@property (nonatomic, assign) NSInteger appSize;
// video duration
@property (nonatomic, assign) NSInteger videoDuration;
/// media configuration parameters.
@property (nonatomic, strong) NSDictionary *mediaExt;
- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError * __autoreleasing *)error;
@end
//
//
// BUNativeAd.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BUAdSlot.h"
#import "BUMaterialMeta.h"
#import "BUVideoAdView.h"
@protocol BUNativeAdDelegate;
NS_ASSUME_NONNULL_BEGIN
/**
Abstract ad slot containing ad data loading, response callbacks.
BUNativeAd currently supports native ads.
Native ads include in-feed ad (multiple ads, image + video), general native ad (single ad, image + video), native banner ad, and native interstitial ad.
Support interstitial ad, banner ad, splash ad, rewarded video ad, full-screen video ad.
*/
@interface BUNativeAd : NSObject
/**
Ad slot description.
*/
@property (nonatomic, strong, readwrite, nullable) BUAdSlot *adslot;
/**
Ad slot material.
*/
@property (nonatomic, strong, readonly, nullable) BUMaterialMeta *data;
/**
The delegate for receiving state change messages.
The delegate is not limited to viewcontroller.
The delegate can be set to any object which conforming to <BUNativeAdDelegate>.
*/
@property (nonatomic, weak, readwrite, nullable) id<BUNativeAdDelegate> delegate;
/**
required.
Root view controller for handling ad actions.
Action method includes is 'presentViewController'.
*/
@property (nonatomic, weak, readwrite) UIViewController *rootViewController;
/**
Initializes native ad with ad slot.
@param slot : ad slot description.
including slotID,adType,adPosition,etc.
@return BUNativeAd
*/
- (instancetype)initWithSlot:(BUAdSlot *)slot;
/**
Register clickable views in native ads view.
Interaction types can be configured on TikTok Audience Network.
Interaction types include view video ad details page, make a call, send email, download the app, open the webpage using a browser,open the webpage within the app, etc.
@param containerView : required.
container view of the native ad.
@param clickableViews : optional.
Array of views that are clickable.
*/
- (void)registerContainer:(__kindof UIView *)containerView
withClickableViews:(NSArray<__kindof UIView *> *_Nullable)clickableViews;
/**
Unregister ad view from the native ad.
*/
- (void)unregisterView;
/**
Actively request nativeAd datas.
*/
- (void)loadAdData;
@end
@protocol BUNativeAdDelegate <NSObject>
@optional
/**
This method is called when native ad material loaded successfully.
*/
- (void)nativeAdDidLoad:(BUNativeAd *)nativeAd;
/**
This method is called when native ad materia failed to load.
@param error : the reason of error
*/
- (void)nativeAd:(BUNativeAd *)nativeAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when native ad slot has been shown.
*/
- (void)nativeAdDidBecomeVisible:(BUNativeAd *)nativeAd;
/**
This method is called when another controller has been closed.
@param interactionType : open appstore in app or open the webpage or view video ad details page.
*/
- (void)nativeAdDidCloseOtherController:(BUNativeAd *)nativeAd interactionType:(BUInteractionType)interactionType;
/**
This method is called when native ad is clicked.
*/
- (void)nativeAdDidClick:(BUNativeAd *)nativeAd withView:(UIView *_Nullable)view;
/**
This method is called when the user clicked dislike reasons.
Only used for dislikeButton in BUNativeAdRelatedView.h
@param filterWords : reasons for dislike
*/
- (void)nativeAd:(BUNativeAd *_Nullable)nativeAd dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterWords;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeAdRelatedView.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUVideoAdView.h"
#import "BUNativeAd.h"
NS_ASSUME_NONNULL_BEGIN
@interface BUNativeAdRelatedView : NSObject
/**
Need to actively add to the view in order to deal with the feedback and improve the accuracy of ad.
*/
@property (nonatomic, strong, readonly, nullable) UIButton *dislikeButton;
/**
Promotion label.Need to actively add to the view.
*/
@property (nonatomic, strong, readonly, nullable) UILabel *adLabel;
/**
Ad logo.Need to actively add to the view.
*/
@property (nonatomic, strong, readonly, nullable) UIImageView *logoImageView;
/**
Ad logo + Promotion label.Need to actively add to the view.
*/
@property (nonatomic, strong, readonly, nullable) UIImageView *logoADImageView;
/**
Video ad view. Need to actively add to the view.
*/
@property (nonatomic, strong, readonly, nullable) BUVideoAdView *videoAdView;
/**
Refresh the data every time you get new datas in order to show ad perfectly.
*/
- (void)refreshData:(BUNativeAd *)nativeAd;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeAdsManager.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
/**
BUNativeAdsManager : for multiple requests at the same time.
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BUAdSlot.h"
#import "BUMaterialMeta.h"
#import "BUNativeAd.h"
@protocol BUNativeAdsManagerDelegate;
NS_ASSUME_NONNULL_BEGIN
/// Bunativeadsmanager class can request multiple ad data per time.
@interface BUNativeAdsManager : NSObject
@property (nonatomic, strong, nullable) BUAdSlot *adslot;
@property (nonatomic, strong, nullable) NSArray<BUNativeAd *> *data;
/// The delegate for receiving state change messages such as requests succeeding/failing.
/// The delegate can be set to any object which conforming to <BUNativeAdsManagerDelegate>.
@property (nonatomic, weak, nullable) id<BUNativeAdsManagerDelegate> delegate;
- (instancetype)initWithSlot:(BUAdSlot * _Nullable) slot;
/**
It is recommended to request no more than 3 ads.
The maximum is 10.
*/
- (void)loadAdDataWithCount:(NSInteger)count;
@end
@protocol BUNativeAdsManagerDelegate <NSObject>
@optional
- (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *_Nullable)nativeAdDataArray;
- (void)nativeAdsManager:(BUNativeAdsManager *)adsManager didFailWithError:(NSError *_Nullable)error;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressAdManager.h
// BUAdSDK
//
// Created by bytedance on 2019/1/20.
// Copyright © 2019年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BUAdSlot.h"
#import "BUNativeExpressAdView.h"
#import "BUDislikeWords.h"
NS_ASSUME_NONNULL_BEGIN
@class BUNativeExpressAdManager;
@protocol BUNativeExpressAdViewDelegate <NSObject>
@optional
/**
* Sent when views successfully load ad
*/
- (void)nativeExpressAdSuccessToLoad:(BUNativeExpressAdManager *)nativeExpressAd views:(NSArray<__kindof BUNativeExpressAdView *> *)views;
/**
* Sent when views fail to load ad
*/
- (void)nativeExpressAdFailToLoad:(BUNativeExpressAdManager *)nativeExpressAd error:(NSError *_Nullable)error;
/**
* This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated
*/
- (void)nativeExpressAdViewRenderSuccess:(BUNativeExpressAdView *)nativeExpressAdView;
/**
* This method is called when a nativeExpressAdView failed to render
*/
- (void)nativeExpressAdViewRenderFail:(BUNativeExpressAdView *)nativeExpressAdView error:(NSError *_Nullable)error;
/**
* Sent when an ad view is about to present modal content
*/
- (void)nativeExpressAdViewWillShow:(BUNativeExpressAdView *)nativeExpressAdView;
/**
* Sent when an ad view is clicked
*/
- (void)nativeExpressAdViewDidClick:(BUNativeExpressAdView *)nativeExpressAdView;
/**
* Sent when a player finished
* @param error : error of player
*/
- (void)nativeExpressAdViewPlayerDidPlayFinish:(BUNativeExpressAdView *)nativeExpressAdView error:(NSError *)error;
/**
* Sent when a user clicked dislike reasons.
* @param filterWords : the array of reasons why the user dislikes the ad
*/
- (void)nativeExpressAdView:(BUNativeExpressAdView *)nativeExpressAdView dislikeWithReason:(NSArray<BUDislikeWords *> *)filterWords;
/**
* Sent after an ad view is clicked, a ad landscape view will present modal content
*/
- (void)nativeExpressAdViewWillPresentScreen:(BUNativeExpressAdView *)nativeExpressAdView;
@end
@interface BUNativeExpressAdManager : NSObject
@property (nonatomic, strong, nullable) BUAdSlot *adslot;
@property (nonatomic, assign, readwrite) CGSize adSize;
/**
The delegate for receiving state change messages from a BUNativeExpressAdManager
*/
@property (nonatomic, weak, nullable) id<BUNativeExpressAdViewDelegate> delegate;
/**
@param size expected ad view size,when size.height is zero, acture height will match size.width
*/
- (instancetype)initWithSlot:(BUAdSlot * _Nullable)slot adSize:(CGSize)size;
/**
The number of ads requested,The maximum is 3
*/
- (void)loadAd:(NSInteger)count;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressAdView.h
// BUAdSDK
//
// Created by bytedance on 2019/1/20.
// Copyright © 2019年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface BUNativeExpressAdView : UIView
/**
* Whether render is ready
*/
@property (nonatomic, assign, readonly) BOOL isReady;
/*
required.
Root view controller for handling ad actions.
*/
@property (nonatomic, weak) UIViewController *rootViewController;
/**
required
*/
- (void)render;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressBannerView.h
// BUAdSDK
//
// Created by xxx on 2019/5/17.
// Copyright © 2019 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class BUNativeExpressBannerView;
@class BUDislikeWords;
@class BUSize;
@protocol BUNativeExpressBannerViewDelegate <NSObject>
@optional
/**
This method is called when bannerAdView ad slot loaded successfully.
@param bannerAdView : view for bannerAdView
*/
- (void)nativeExpressBannerAdViewDidLoad:(BUNativeExpressBannerView *)bannerAdView;
/**
This method is called when bannerAdView ad slot failed to load.
@param error : the reason of error
*/
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView didLoadFailWithError:(NSError *_Nullable)error;
/**
This method is called when rendering a nativeExpressAdView successed.
*/
- (void)nativeExpressBannerAdViewRenderSuccess:(BUNativeExpressBannerView *)bannerAdView;
/**
This method is called when a nativeExpressAdView failed to render.
@param error : the reason of error
*/
- (void)nativeExpressBannerAdViewRenderFail:(BUNativeExpressBannerView *)bannerAdView error:(NSError * __nullable)error;
/**
This method is called when bannerAdView ad slot showed new ad.
*/
- (void)nativeExpressBannerAdViewWillBecomVisible:(BUNativeExpressBannerView *)bannerAdView;
/**
This method is called when bannerAdView is clicked.
*/
- (void)nativeExpressBannerAdViewDidClick:(BUNativeExpressBannerView *)bannerAdView;
/**
This method is called when the user clicked dislike button and chose dislike reasons.
@param filterwords : the array of reasons for dislike.
*/
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterwords;
@end
@interface BUNativeExpressBannerView : UIView
@property (nonatomic, weak, nullable) id<BUNativeExpressBannerViewDelegate> delegate;
/**
The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
*/
@property (nonatomic, assign, readonly) NSInteger interval;
- (instancetype)initWithSlotID:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
imgSize:(BUSize * __nullable )expectSize
adSize:(CGSize)adsize
IsSupportDeepLink:(BOOL)isSupportDeepLink;
- (instancetype)initWithSlotID:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
imgSize:(BUSize * __nullable )expectSize
adSize:(CGSize)adsize
IsSupportDeepLink:(BOOL)isSupportDeepLink
interval:(NSInteger)interval;
- (void)loadAdData;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressFullscreenVideoAd.h
// BUAdSDK
//
// Copyright © 2019 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
@class BUNativeExpressFullscreenVideoAd;
NS_ASSUME_NONNULL_BEGIN
@protocol BUNativeExpressFullscreenVideoAdDelegate <NSObject>
@optional
/**
This method is called when video ad material loaded successfully.
*/
- (void)nativeExpressFullscreenVideoAdDidLoad:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad materia failed to load.
@param error : the reason of error
*/
- (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when rendering a nativeExpressAdView successed.
*/
- (void)nativeExpressFullscreenVideoAdViewRenderSuccess:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd;
/**
This method is called when a nativeExpressAdView failed to render.
@param error : the reason of error
*/
- (void)nativeExpressFullscreenVideoAdViewRenderFail:(BUNativeExpressFullscreenVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error;
/**
This method is called when video cached successfully.
*/
- (void)nativeExpressFullscreenVideoAdDidDownLoadVideo:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot will be showing.
*/
- (void)nativeExpressFullscreenVideoAdWillVisible:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot has been shown.
*/
- (void)nativeExpressFullscreenVideoAdDidVisible:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is clicked.
*/
- (void)nativeExpressFullscreenVideoAdDidClick:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when the user clicked skip button.
*/
- (void)nativeExpressFullscreenVideoAdDidClickSkip:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is about to close.
*/
- (void)nativeExpressFullscreenVideoAdWillClose:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is closed.
*/
- (void)nativeExpressFullscreenVideoAdDidClose:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad play completed or an error occurred.
@param error : the reason of error
*/
- (void)nativeExpressFullscreenVideoAdDidPlayFinish:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
@end
@interface BUNativeExpressFullscreenVideoAd : NSObject
@property (nonatomic, weak, nullable) id<BUNativeExpressFullscreenVideoAdDelegate> delegate;
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
/**
Initializes video ad with slot id.
@param slotID : the unique identifier of video ad.
@return BUFullscreenVideoAd
*/
- (instancetype)initWithSlotID:(NSString *)slotID;
/**
Load video ad datas.
*/
- (void)loadAdData;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@param sceneDescirbe : optional. Identifies a custom description of the presentation scenario.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressInterstitialAd.h
// BUAdSDK
//
// Created by xxx on 2019/5/16.
// Copyright © 2019 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class BUSize;
@class BUNativeExpressInterstitialAd;
@protocol BUNativeExpresInterstitialAdDelegate <NSObject>
@optional
/**
This method is called when interstitial ad material loaded successfully.
*/
- (void)nativeExpresInterstitialAdDidLoad:(BUNativeExpressInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad material failed to load.
@param error : the reason of error
*/
- (void)nativeExpresInterstitialAd:(BUNativeExpressInterstitialAd *)interstitialAd didFailWithError:(NSError * __nullable)error;
/**
This method is called when rendering a nativeExpressAdView successed.
*/
- (void)nativeExpresInterstitialAdRenderSuccess:(BUNativeExpressInterstitialAd *)interstitialAd;
/**
This method is called when a nativeExpressAdView failed to render.
@param error : the reason of error
*/
- (void)nativeExpresInterstitialAdRenderFail:(BUNativeExpressInterstitialAd *)interstitialAd error:(NSError * __nullable)error;
/**
This method is called when interstitial ad slot will be showing.
*/
- (void)nativeExpresInterstitialAdWillVisible:(BUNativeExpressInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is clicked.
*/
- (void)nativeExpresInterstitialAdDidClick:(BUNativeExpressInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is about to close.
*/
- (void)nativeExpresInterstitialAdWillClose:(BUNativeExpressInterstitialAd *)interstitialAd;
/**
This method is called when interstitial ad is closed.
*/
- (void)nativeExpresInterstitialAdDidClose:(BUNativeExpressInterstitialAd *)interstitialAd;
@end
@interface BUNativeExpressInterstitialAd : NSObject
@property (nonatomic, weak, nullable) id<BUNativeExpresInterstitialAdDelegate> delegate;
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
/**
Initializes interstitial ad.
@param slotID : The unique identifier of interstitial ad.
@param expectSize : custom size of image, default 600px * 400px.
@param adsize : custom size of ad view.
@return BUInterstitialAd
*/
- (instancetype)initWithSlotID:(NSString *)slotID imgSize:(BUSize * __nullable )expectSize adSize:(CGSize)adsize;
/**
Load interstitial ad datas.
*/
- (void)loadAdData;
/**
Display interstitial ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
@end
NS_ASSUME_NONNULL_END
//
//
// BUNativeExpressRewardedVideoAd.h
// BUAdSDK
//
// Copyright © 2019 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUAdSDKDefines.h"
@class BUNativeExpressRewardedVideoAd;
@class BURewardedVideoModel;
NS_ASSUME_NONNULL_BEGIN
@protocol BUNativeExpressRewardedVideoAdDelegate <NSObject>
@optional
/**
This method is called when video ad material loaded successfully.
*/
- (void)nativeExpressRewardedVideoAdDidLoad:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad materia failed to load.
@param error : the reason of error
*/
- (void)nativeExpressRewardedVideoAd:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when cached successfully.
*/
- (void)nativeExpressRewardedVideoAdDidDownLoadVideo:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when rendering a nativeExpressAdView successed.
*/
- (void)nativeExpressRewardedVideoAdViewRenderSuccess:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when a nativeExpressAdView failed to render.
@param error : the reason of error
*/
- (void)nativeExpressRewardedVideoAdViewRenderFail:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error;
/**
This method is called when video ad slot will be showing.
*/
- (void)nativeExpressRewardedVideoAdWillVisible:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad slot has been shown.
*/
- (void)nativeExpressRewardedVideoAdDidVisible:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is about to close.
*/
- (void)nativeExpressRewardedVideoAdWillClose:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is closed.
*/
- (void)nativeExpressRewardedVideoAdDidClose:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is clicked.
*/
- (void)nativeExpressRewardedVideoAdDidClick:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when the user clicked skip button.
*/
- (void)nativeExpressRewardedVideoAdDidClickSkip:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad play completed or an error occurred.
@param error : the reason of error
*/
- (void)nativeExpressRewardedVideoAdDidPlayFinish:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;
/**
Server verification which is requested asynchronously is succeeded.
@param verify :return YES when return value is 2000.
*/
- (void)nativeExpressRewardedVideoAdServerRewardDidSucceed:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd verify:(BOOL)verify;
/**
Server verification which is requested asynchronously is failed.
Return value is not 2000.
*/
- (void)nativeExpressRewardedVideoAdServerRewardDidFail:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;
@end
@interface BUNativeExpressRewardedVideoAd : NSObject
@property (nonatomic, strong) BURewardedVideoModel *rewardedVideoModel;
@property (nonatomic, weak, nullable) id<BUNativeExpressRewardedVideoAdDelegate> delegate;
/**
Whether material is effective.
Setted to YES when data is not empty and has not been displayed.
Repeated display is not billed.
*/
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
- (instancetype)initWithSlotID:(NSString *)slotID rewardedVideoModel:(BURewardedVideoModel *)model;
- (void)loadAdData;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
If ritSceneType is custom, you need to pass in the values for sceneDescirbe.
@param ritSceneType : optional. Identifies a custom description of the presentation scenario.
@param sceneDescirbe : optional. Identify the scene of presentation.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritScene:(BURitSceneType)ritSceneType ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
@end
NS_ASSUME_NONNULL_END
//
//
// BUPlayerPublicDefine.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#ifndef BUPlayerPublicDefine_h
#define BUPlayerPublicDefine_h
typedef NS_ENUM(NSInteger, BUPlayerPlayState) {
BUPlayerStateFailed = 0,
BUPlayerStateBuffering = 1,
BUPlayerStatePlaying = 2,
BUPlayerStateStopped = 3,
BUPlayerStatePause = 4,
BUPlayerStateDefalt = 5
};
@class BUPlayer;
@protocol BUPlayerDelegate <NSObject>
@optional
/**
This method is called when the player status changes.
*/
- (void)player:(BUPlayer *)player stateDidChanged:(BUPlayerPlayState)playerState;
/**
This method is called when the player is ready.
*/
- (void)playerReadyToPlay:(BUPlayer *)player;
/**
This method is called when the player plays completion or occurrs error.
*/
- (void)playerDidPlayFinish:(BUPlayer *)player error:(NSError *)error;
/**
This method is called when the player is clicked.
*/
- (void)player:(BUPlayer *)player recognizeTapGesture:(UITapGestureRecognizer *)gesture;
/**
This method is called when the view is clicked during ad play.
*/
- (void)playerTouchesBegan:(BUPlayer *)player;
@end
#endif /* BUPlayerPublicDefine_h */
//
//
// BURewardedVideoAd.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUAdSDKDefines.h"
NS_ASSUME_NONNULL_BEGIN
@protocol BURewardedVideoAdDelegate;
@class BURewardedVideoModel;
@interface BURewardedVideoAd : NSObject
@property (nonatomic, strong) BURewardedVideoModel *rewardedVideoModel;
@property (nonatomic, weak, nullable) id<BURewardedVideoAdDelegate> delegate;
/**
Whether material is effective.
Setted to YES when data is not empty and has not been displayed.
Repeated display is not billed.
*/
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
- (instancetype)initWithSlotID:(NSString *)slotID rewardedVideoModel:(BURewardedVideoModel *)model;
- (void)loadAdData;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
If ritSceneType is custom, you need to pass in the values for sceneDescirbe.
@param ritSceneType : optional. Identifies a custom description of the presentation scenario.
@param sceneDescirbe : optional. Identify the scene of presentation.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritScene:(BURitSceneType)ritSceneType ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
@end
@protocol BURewardedVideoAdDelegate <NSObject>
@optional
/**
This method is called when video ad material loaded successfully.
*/
- (void)rewardedVideoAdDidLoad:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad materia failed to load.
@param error : the reason of error
*/
- (void)rewardedVideoAd:(BURewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when cached successfully.
*/
- (void)rewardedVideoAdVideoDidLoad:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad slot will be showing.
*/
- (void)rewardedVideoAdWillVisible:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad slot has been shown.
*/
- (void)rewardedVideoAdDidVisible:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is about to close.
*/
- (void)rewardedVideoAdWillClose:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is closed.
*/
- (void)rewardedVideoAdDidClose:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad is clicked.
*/
- (void)rewardedVideoAdDidClick:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when video ad play completed or an error occurred.
@param error : the reason of error
*/
- (void)rewardedVideoAdDidPlayFinish:(BURewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;
/**
Server verification which is requested asynchronously is succeeded.
@param verify :return YES when return value is 2000.
*/
- (void)rewardedVideoAdServerRewardDidSucceed:(BURewardedVideoAd *)rewardedVideoAd verify:(BOOL)verify;
/**
Server verification which is requested asynchronously is failed.
Return value is not 2000.
*/
- (void)rewardedVideoAdServerRewardDidFail:(BURewardedVideoAd *)rewardedVideoAd;
/**
This method is called when the user clicked skip button.
*/
- (void)rewardedVideoAdDidClickSkip:(BURewardedVideoAd *)rewardedVideoAd;
@end
NS_ASSUME_NONNULL_END
//
//
// BURewardedVideoModel.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BURewardedVideoModel : NSObject
/**
required.
Third-party game user_id identity.
Mainly used in the reward issuance, it is the callback pass-through parameter from server-to-server.
It is the unique identifier of each user.
In the non-server callback mode, it will also be pass-through when the video is finished playing.
Only the string can be passed in this case, not nil.
*/
@property (nonatomic, copy) NSString *userId;
//optional. reward name.
@property (nonatomic, copy) NSString *rewardName;
//optional. number of rewards.
@property (nonatomic, assign) NSInteger rewardAmount;
//optional. serialized string.
@property (nonatomic, copy) NSString *extra;
@end
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment