Commit 5bd4b1e8 by 刘卓鑫

提交最新改动

parent 0bd9ac4d
......@@ -29,21 +29,5 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/AD(&#x5e7f;&#x544a;)/ZXTXAdTool.m"
timestampString = "589796272.887374"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "86"
endingLineNumber = "86"
landmarkName = "-splashAdFailToPresent:withError:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -36,7 +36,7 @@
#import <SDWebImage/SDImageCache.h>
#import "YYFPSLabel.h"
#import "ZXAdTool.h"
#import "ZXAdViewAdTool.h"
#define TIME_ANIMATION 1.0
#define PERSPECTIVE -1.0 / 200.0
#define ROTATION_ANGLE M_PI_2
......@@ -76,7 +76,7 @@
//开屏广告
[ZXAdTool startLauchAd];
//版本检测
[self checkVersion];
......@@ -84,7 +84,7 @@
// [kAppWindow addSubview:fps];
//默认配置
[self defaultLauchConfigAndIsOpenPreventCrashManager:NO];
[self defaultLauchConfigAndIsOpenPreventCrashManager:YES];
//防止蓝牙洗浴后台运行被系统中断
......
//
//
// ZXAdViewAdTool.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/9/16.
// Copyright © 2019 Colorful Any Door. All rights reserved.
// addView广告
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXAdViewAdTool : NSObject
- (void) startLauchAd;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXAdViewAdTool.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/9/16.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAdViewAdTool.h"
#import "AdCompView.h"
#import "AdCompView+Impl.h"
#import "AdCompViewDelegate.h"
@interface ZXAdViewAdTool ()<AdCompViewDelegate>
@property (strong, nonatomic) AdCompView *spread;
@end
@implementation ZXAdViewAdTool
- (void) startLauchAd {
self.spread = [AdCompView requestSpreadActivityWithDelegate:self withAdPlatType:ADCOMPVIEWADPLATTYPE_ADVIEW];
}
#pragma mark - adcompview delegate
-(NSString*) appId {
return @"SDK20191516030954opvyhmi3khwalbw";
}
- (UIViewController*)viewControllerForShowModal {
return kAppWindow.rootViewController;
}
- (BOOL)testMode{
return YES;
}
- (BOOL)logMode{
return YES;
}
@end
//
//
// BDADHeader.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/3/22.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#ifndef BDADHeader_h
#define BDADHeader_h
//多彩
//#define kBaiduAdAppId @"f180f331"
//#define kBaiduAdAdPlacementId @"6102241"
//百度
#define kBaiduAdAppId @"ccb60059"
#define kBaiduAdAdPlacementId @"3722589"
#endif /* BDADHeader_h */
//
//
// ZXBDTool.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/3/21.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXBDTool : NSObject
//单例化
kSINGLETON_FOR_HEADER(ZXBDTool)
- (void) createNativieAdByView:(UIView *) view
topView:(UIView *) topView
viewController:(UIViewController *) viewController
isFirstPage:(BOOL) isFirstPage
isHasBottomMargin:(BOOL) isHasBottomMargin;
- (void) destoryAdView;
@property (nonatomic, copy) dispatch_block_t closeAction;
- (void) createBaiduLauchAdView;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXBDTool.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/3/21.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXBDTool.h"
#import "BaiduMobAdSDK/BaiduMobAdView.h"
#import "BaiduMobAdSDK/BaiduMobAdSetting.h"
#import "BaiduMobAdSDK/BaiduMobAdSplash.h"
#import "BDADHeader.h"
@interface ZXBDTool ()<BaiduMobAdViewDelegate, BaiduMobAdSplashDelegate> {
BaiduMobAdView *sharedAdView;
}
@property (nonatomic, strong) dispatch_source_t gcdTimer;
@end
@implementation ZXBDTool
kSINGLETON_FOR_CLASS(ZXBDTool)
#pragma mark - 创建百度广告view
- (void) createNativieAdByView:(UIView *) view
topView:(UIView *) topView
viewController:(UIViewController *) viewController
isFirstPage:(BOOL) isFirstPage
isHasBottomMargin:(BOOL) isHasBottomMargin {
[BaiduMobAdSetting setLpStyle:BaiduMobAdLpStyleDefault];
//使用嵌入广告的方法实例。
sharedAdView = [[BaiduMobAdView alloc] init];
sharedAdView.AdUnitTag = kBaiduAdAdPlacementId;
sharedAdView.AdType = BaiduMobAdViewTypeBanner;
[view addSubview:sharedAdView];
if (isFirstPage) {
[sharedAdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(view.mas_left).offset(5 * k6Scale);
make.right.equalTo(view.mas_right).offset(-5 * k6Scale);
make.height.mas_equalTo(kScreenWidth * 0.15);
make.bottom.equalTo([ZXPayManager sharedZXPayManager].notPayOrderView.mas_top);
}];
} else {
if (isHasBottomMargin) {
CGFloat margin = 49;
if (iPhoneX) {
margin = 83;
}
[sharedAdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(view.mas_left).offset(5 * k6Scale);
make.right.equalTo(view.mas_right).offset(-5 * k6Scale);
make.height.mas_equalTo(kScreenWidth * 0.15);
make.bottom.equalTo(view.mas_bottom).offset(-margin);
}];
} else {
if (topView) {
[sharedAdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(view.mas_left).offset(5 * k6Scale);
make.right.equalTo(view.mas_right).offset(-5 * k6Scale);
make.height.mas_equalTo(kScreenWidth * 0.15);
make.top.equalTo(topView.mas_bottom).offset(5 * k6Scale);
}];
} else {
[sharedAdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(view).offset(5 * k6Scale);
make.right.equalTo(view).offset(-5 * k6Scale);
make.height.mas_equalTo((kScreenWidth - 10) * 0.15);
make.bottom.equalTo(view);
}];
}
}
}
sharedAdView.delegate = self;
[sharedAdView start];
if (isFirstPage == NO && isHasBottomMargin == NO && topView == nil) {
[self createRemoveAdView:sharedAdView];
} else {
[self createCountingDowViewByAdView:sharedAdView];
}
}
#pragma mark - ========== 创建删除view ==========
- (void) createRemoveAdView:(BaiduMobAdView *) expressView{
UIImageView *closeBg = [[UIImageView alloc] init];
[expressView addSubview:closeBg];
closeBg.userInteractionEnabled = YES;
closeBg.image = [UIImage imageNamed:@"wwww"];
[closeBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(expressView.mas_right).offset(-5 * k6Scale);
make.top.equalTo(expressView.mas_top).offset(5 * k6Scale);
}];
UILabel *closeLabel = [[UILabel alloc] init];
closeLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
[closeBg addSubview:closeLabel];
closeLabel.font = kFontSize(12 * k6Scale);
[closeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(closeBg);
}];
closeLabel.text = @"X 关闭";
UITapGestureRecognizer *closeCountingDown = [[UITapGestureRecognizer alloc] init];
[closeBg addGestureRecognizer:closeCountingDown];
@weakify(self);
[[closeCountingDown rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
//移除广告
[self removeCoverAd:expressView];
if (self.closeAction) {
self.closeAction();
}
}];
}
#pragma mark - ========== 创建倒计时view ==========
- (void) createCountingDowViewByAdView:(BaiduMobAdView *) expressView {
UIImageView *closeBg = [[UIImageView alloc] init];
[expressView addSubview:closeBg];
closeBg.userInteractionEnabled = YES;
closeBg.image = [UIImage imageNamed:@"wwww"];
[closeBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(expressView.mas_right).offset(-10 * k6Scale);
make.top.equalTo(expressView.mas_top).offset(10 * k6Scale);
}];
UILabel *closeLabel = [[UILabel alloc] init];
closeLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
[closeBg addSubview:closeLabel];
closeLabel.font = kFontSize(12 * k6Scale);
[closeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(closeBg);
}];
__block int cou = 3;
closeLabel.text = [NSString stringWithFormat:@"%ld 跳过", (long)cou];
UITapGestureRecognizer *closeCountingDown = [[UITapGestureRecognizer alloc] init];
[closeBg addGestureRecognizer:closeCountingDown];
self.gcdTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_timer(self.gcdTimer, DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(self.gcdTimer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
closeLabel.text = [NSString stringWithFormat:@"%d 跳过", (int)cou];
if(cou == 0) {
// 终止定时器
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
//移除广告
[self removeCoverAd:expressView];
}
cou --;
});
});
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
@weakify(self);
[[closeCountingDown rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
// 终止定时器
if (self.gcdTimer) {
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
}
//移除广告
[self removeCoverAd:expressView];
}];
}
- (void) removeCoverAd:(BaiduMobAdView *) expressView {
expressView.hidden = YES;
expressView.delegate = nil;
[expressView removeFromSuperview];
}
#pragma mark - 销毁广告view
- (void) destoryAdView {
sharedAdView.delegate = nil;
sharedAdView = nil;
}
#pragma mark - BaiduMobAdViewDelegate
- (NSString *)publisherId
{
return kBaiduAdAppId;
}
-(BOOL) enableLocation
{
//启用location会有一次alert提示
return YES;
}
-(void) willDisplayAd:(BaiduMobAdView*) adview
{
NSLog(@"delegate: will display ad");
}
-(void) failedDisplayAd:(BaiduMobFailReason) reason;
{
NSLog(@"delegate: failedDisplayAd %d", reason);
}
- (void)didAdImpressed {
NSLog(@"delegate: didAdImpressed");
}
- (void)didAdClicked {
NSLog(@"delegate: didAdClicked");
}
#pragma mark - 开屏广告
- (void)createBaiduLauchAdView {
BaiduMobAdSplash *splash = [[BaiduMobAdSplash alloc] init];
splash.delegate = self;
splash.AdUnitTag = @"";
splash.presentAdViewController = [ZXTool getCurrentVC];;
[splash loadAndDisplayUsingKeyWindow:kAppWindow];
}
#pragma mark - 开屏广告相关代理
/**
* 广告展示成功
*/
- (void)splashSuccessPresentScreen:(BaiduMobAdSplash *)splash {
}
/**
* 广告展示失败
*/
- (void)splashlFailPresentScreen:(BaiduMobAdSplash *)splash withError:(BaiduMobFailReason) reason {
}
/**
* 广告被点击
*/
- (void)splashDidClicked:(BaiduMobAdSplash *)splash {
}
/**
* 广告展示结束
*/
- (void)splashDidDismissScreen:(BaiduMobAdSplash *)splash {
}
/**
* 广告详情页消失
*/
- (void)splashDidDismissLp:(BaiduMobAdSplash *)splash {
}
/**
* 广告加载完成
* adType:广告类型 BaiduMobMaterialType
* videoDuration:视频时长,仅广告为视频时出现。非视频类广告默认0。 单位ms
*/
- (void)splashDidReady:(BaiduMobAdSplash *)splash
AndAdType:(NSString *)adType
VideoDuration:(NSInteger)videoDuration {
}
@end
//
//
......@@ -11,6 +11,8 @@
#import "ZXFullScreenAdView.h"
#import "ZXHomePageWebViewController.h"
#import <JDSDK/KeplerApiManager.h>
#import "ZXAdViewAdTool.h"
#import "ZXBDTool.h"
@implementation ZXAdTool
......@@ -67,7 +69,20 @@
dispatch_async(dispatch_get_main_queue(), ^{
if (lauch.isButt) {
[[ZXTXAdTool sharedZXTXAdTool] createLauchAdByPlacmentId:kTXAdLauchPLACEMENTID];
switch (lauch.platformSource) {
case 1: //腾讯
[[ZXTXAdTool sharedZXTXAdTool] createLauchAdByPlacmentId:kTXAdLauchPLACEMENTID];
break;
case 2: //百度
[[ZXBDTool sharedZXBDTool] createBaiduLauchAdView];
break;
case 5: //addView
[[[ZXAdViewAdTool alloc] init] startLauchAd];
break;
default:
break;
}
} else {
if (lauch.advertImg == nil || [lauch.advertImg isEqualToString:@""]) {
return ;
......
//
//
......@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
/** 是否对接 */
@property (nonatomic, assign) NSInteger isButt;
/** "平台来源 1腾讯 2百度 3瑞狮 4友盟" */
/** "平台来源 1腾讯 2百度 3瑞狮 4友盟 5adView" */
@property (nonatomic, assign) NSInteger platformSource;
/** 广告标题 */
......
//
//
......@@ -166,7 +166,7 @@
if (iPhoneX) {
bottomH = 34;
}
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kTopHeight + 13 * k6Scale, kScreenWidth, kScreenHeight - bottomH - 49 - kTopHeight - 35 * k6Scale) style:UITableViewStyleGrouped];
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kTopHeight + 13 * k6Scale, kScreenWidth, kScreenHeight - bottomH - 49 - kTopHeight - 13 * k6Scale) style:UITableViewStyleGrouped];
_myTableView.delegate = self;
_myTableView.dataSource = self;
......
//
//
......@@ -93,7 +93,7 @@
self.clientSocket = [[GCDAsyncSocket alloc]initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
//开始建立连接
[self.clientSocket connectToHost:[kUserDefaults objectForKey:@"BATHSocketUrl"] onPort:[[kUserDefaults objectForKey:@"BATHSocketPort"] integerValue] viaInterface:nil withTimeout:-1 error:nil];
NSLog(@"😇😇😇😇😇😇 socket开始连接---%@", [ZXTool getTimeNow]);
@weakify(self);
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
......@@ -379,6 +379,7 @@
[self.view addSubview:a];
return;
}
NSLog(@"😇😇😇😇😇😇 开始搜索蓝牙---%@", [ZXTool getTimeNow]);
[self sendMessage:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]];
self.isServiceCut = NO;//标记为开始
self.startDrink.enabled = NO;//按钮不可点击
......@@ -419,12 +420,13 @@
}
#pragma mark - ==========开始洗浴接口调用==========
- (void) startBathByBluetooth {
NSLog(@"😇😇😇😇😇😇 开始调用接口开启设备---%@", [ZXTool getTimeNow]);
[SVProgressHUD showSuccessWithStatus:@"设备开启中..."];
NSString *url = [NSString stringWithFormat:@"%@/dcxy/api/shower/devices/%@/beginning", [kUserDefaults valueForKey:@"BATH"], self.currentPeripheralName];
@weakify(self);
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:url para:@{@"customerId":[kUserDefaults valueForKey:@"userId"], @"customerName":[kUserDefaults valueForKey:@"username"], @"customerPhone":[kUserDefaults valueForKey:@"account"],@"campusId":[kUserDefaults valueForKey:@"campusId"]} completed:^(CommonModel *common, NSString *error) {
@strongify(self);
NSLog(@"😇😇😇😇😇😇 结束调用接口开启设备---%@", [ZXTool getTimeNow]);
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[SVProgressHUD dismiss];
......@@ -608,15 +610,17 @@
{
// 判断是否是你需要连接的设备
if (peripheral.name) {
NSLog(@"发现设备:%@", peripheral.name);
}
if ([peripheral.name isEqualToString:self.currentPeripheralName]) {
NSLog(@"发现设备:%@", self.currentPeripheralName);
NSLog(@"😇😇😇😇😇😇 搜索到蓝牙设备---%@", [ZXTool getTimeNow]);
if (self.selectedPeripheral == nil) {
self.selectedPeripheral = peripheral;
self.selectedPeripheral.delegate = self;
}
NSLog(@"😇😇😇😇😇😇 开始连接蓝牙---%@", [ZXTool getTimeNow]);
// 开始连接设备
[self.centralManager connectPeripheral:self.selectedPeripheral options:nil];
[self stopScanPeripheral];
......@@ -665,6 +669,7 @@
#pragma mark - ==========蓝牙连接成功==========
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error {
NSLog(@"=========================蓝牙连接成功=========================");
NSLog(@"😇😇😇😇😇😇 蓝牙设备连接成功---%@", [ZXTool getTimeNow]);
[SVProgressHUD showSuccessWithStatus:@"蓝牙连接成功"];
[self sendDeviceInfoToSocketByTimes:1];
//开始洗浴
......@@ -718,13 +723,15 @@
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(nullable NSError *)error {
[SVProgressHUD dismiss];
NSLog(@"蓝牙连接失败--错误信息:%@", error);
NSLog(@"😇😇😇😇😇😇 蓝牙设备连接失败---%@", [ZXTool getTimeNow]);
}
#pragma mark - ==========蓝牙设备连接断开==========
- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
{
NSLog(@"=====================蓝牙已断开连接:%@=====================", error);
NSLog(@"================蓝牙已断开连接:%@=================", error);
NSLog(@"😇😇😇😇😇😇 蓝牙设备连接已经断开---%@", [ZXTool getTimeNow]);
if (self.isServiceCut == NO && self.startDrink.enabled==NO) {
//重新连接--断开重连的时候 标记e为已经开始 避免二次调用开始接口
self.isBegingBath = YES;
......@@ -837,9 +844,9 @@
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port {
NSLog(@"=========================scoket链接成功=========================");
NSLog(@"================scoket链接成功===================");
self.isSocketConnected = YES;
NSLog(@"😇😇😇😇😇😇 socket连接成功---%@", [ZXTool getTimeNow]);
//断开重连的时候发送一下设备信息(预防一种场景是蓝牙连接成功了 但是socket没连接成功的情况)
if (self.currentPeripheralName && (self.selectedPeripheral && self.selectedPeripheral.state == CBPeripheralStateConnected)) {
[self sendMessage:[NSString stringWithFormat:@"{<%@>}", self.currentPeripheralName]];
......@@ -891,15 +898,13 @@
}
}
}
}
// 链接失败
- (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err{
//重连
self.isSocketConnected = NO;
NSLog(@"😇😇😇😇😇😇 socket连接已经断开---%@", [ZXTool getTimeNow]);
NSLog(@"==============socket链接失败或者断开===================");
if (self.isServiceCut == NO) {
//默认状态下需要重新连接
......
//
//
......@@ -74,7 +74,7 @@
[self.offlineList removeAllObjects];
}
completedBlock(YES);
[ZXTool showErrorMsg:error];
[ZXTool showText:error];
});
} else {
......@@ -203,7 +203,7 @@
@strongify(self);
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showErrorMsg:error];
[ZXTool showText:error];
[self.allMerthinList removeAllObjects];
[self.allMerthinList addObjectsFromArray:[ZXWashLocationModel findAll]];
completedBlock(YES);
......
//
//
......@@ -81,6 +81,8 @@ typedef void(^checkIsOldCustomer)(BOOL isOld);
+(NSString*)getCurrentTimeStamp;
//获取当前时间
+(NSString*)getCurrentTime;
//获取当前时间 精确到毫秒
+(NSString *)getTimeNow;
//时间戳转换成时间
+ (NSString *) returnDateByTimeIntervel:(NSInteger) time;
//保存异常信息
......
//
//
......@@ -685,9 +685,20 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
NSDate * senddate=[NSDate date];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSString * locationString=[dateformatter stringFromDate:senddate];
NSString *locationString=[dateformatter stringFromDate:senddate];
return locationString;
}
//获取当前时间 精确到毫秒
+ (NSString *)getTimeNow {
NSString* date;
NSDateFormatter * formatter = [[NSDateFormatter alloc ] init];
[formatter setDateFormat:@"YYYY-MM-dd hh:mm:ss:SSS"];
date = [formatter stringFromDate:[NSDate date]];
NSString *timeNow = [[NSString alloc] initWithFormat:@"%@", date];
return timeNow;
}
#pragma mark - ========== 异常信息收集 ==========
+(void)saveException:(NSException *)exception {
......
//
//
// AdCompNativeAd.h
// KuaiYouAdHello
//
// Created by maming on 15/10/22.
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class AdCompNativeAd;
@class RolloverManager;
typedef NS_ENUM(NSUInteger, AdCompNativeMediaPlayerStatus) {
AdCompNativeMediaPlayerStatusInitial = 0, // 初始状态
AdCompNativeMediaPlayerStatusLoading = 1, // 加载中
AdCompNativeMediaPlayerStatusStarted = 2, // 开始播放
AdCompNativeMediaPlayerStatusPaused = 3, // 用户行为导致暂停
AdCompNativeMediaPlayerStatusStoped = 4, // 播放停止
AdCompNativeMediaPlayerStatusError = 5, // 播放出错
};
typedef NS_ENUM(NSUInteger, AdCompNativeVideoStatus) {
AdCompNativeVideoStatus_StartPlay,
AdCompNativeVideoStatus_MiddlePlay,
AdCompNativeVideoStatus_CompletePlay,
AdCompNativeVideoStatus_Pause,
AdCompNativeVideoStatus_TerminationPlay,
};
@interface AdCompNativeData : NSObject
/*
* 广告内容字典
* 详解:开发者调用loadNativeAdWithCount:成功之后返回广告内容,
* 从该属性中获取以字典形式存储的广告数据
*/
@property (nonatomic, strong) NSDictionary *adProperties;
@property (nonatomic, strong) NSString* nativeAdId;
@property (nonatomic, strong) RolloverManager *rolloverManager;
@end
@interface AdCompNativeVideoDataAcquisitionObject : NSObject
@property (nonatomic, assign) int duration; // 视频总时长,单位为秒
@property (nonatomic, assign) int beginTime; // 视频播放开始时间,单位为妙。如果视频从头开始播放,则为0
@property (nonatomic, assign) int endTime; // 视频播放结束时间,单位为妙。如果视频播放到结尾,则等于视频总时长
@property (nonatomic, assign) int firstFrame; // 视频是否从第一帧开始播放。是的话为1,否则为0
@property (nonatomic, assign) int lastFrame; // 视频是否播放到最后一帧。播放到最后一帧则为1;否则为0
@property (nonatomic, assign) int scene;
// 视频播放场景;
// 1-> 在广告曝光区域播放
// 2-> 全屏竖屏、只展示视频
// 3-> 全屏竖屏、屏幕上方展示视频、下方展示广告推广页面
// 4-> 全屏横屏、只展示视频
// 0-> 其他自定义场景
@property (nonatomic, assign) int type;
// 播放类型
// 1-> 第一次播放
// 2-> 暂停后继续播放
// 3-> 重新开始播放
@property (nonatomic, assign) int behavior;
// 播放行为
// 1-> 自动播放
// 2-> 点击播放
@property (nonatomic, assign) int status;
// 播放状态
// 0-> 正常播放
// 1-> 视频加载中
// 2-> 下载或播放错误
@end
@protocol AdCompNativeAdDelegate <NSObject>
/*
* 原⽣广告加载广告数据成功回调
* @param nativeDataArray 为 AdCompNativeData对象或者View类型的数组,即广告内容数组或广告View数组
*/
- (void)adCompNativeAdSuccessToLoadAd:(AdCompNativeAd*)adCompNativeAd NativeData:(NSArray*)nativeDataArray;
/*
* 原⽣广告加载广告数据失败回调
* @param error 为加载失败返回的错误信息
*/
- (void)adCompNativeAdFailToLoadAd:(AdCompNativeAd*)adCompNativeAd WithError:(NSError*)error;
/*
* 原⽣广告后将要展示内嵌浏览器回调
*/
- (void)adCompNativeAdWillShowPresent;
/*
* 原⽣广告点击后,内嵌浏览器被关闭时回调
*/
- (void)adCompNativeAdDismissScreen;
/*
* 原⽣广告点击之后应用进入后台时回调
*/
- (void)adCompNativeAdResignActive;
/*
* 原⽣广告视图模板广告view点击关闭按钮是调用,作用于 AdCompNativeAdType_View(视图广告) 广告下
* @param view 关闭的视图view
*/
- (void)adCompNativeAdViewClickClosed:(UIView*)view;
/*
* 原⽣广告视频播放状态更新回调,作用于 AdCompNativeAdType_View(视图广告) 广告下
*/
- (void)adCompNativeViewVideoPlayerStatusChanged:(AdCompNativeMediaPlayerStatus)status;
@end
/*
* 原生广告返回数据的类型
*/
typedef NS_ENUM(NSUInteger, AdCompNativeAdType) {
AdCompNativeAdType_Data = 0, // 数据类型
AdCompNativeAdType_View // 视图类型
};
@interface AdCompNativeAd : NSObject
@property (nonatomic, weak) id<AdCompNativeAdDelegate> delegate;
/*
* viewControllerForPresentingModalView
*/
@property (nonatomic, weak) UIViewController *controller;
@property (nonatomic, assign, readonly) AdCompNativeAdType natviewAdType;
/*
* 在非WiFi网络下是否自动播放,默认为 NO,load前设置。作用于 AdCompNativeAdType_View 广告形式下
*/
@property (nonatomic, assign) BOOL autoPlayVideoOnWWAN;
/*
* 播放广告时,是否需要静音,默认为 YES,load前设置。作用于 AdCompNativeAdType_View 广告形式下
*/
@property (nonatomic, assign) BOOL isNeedMuted;
/*
* 广告展示宽高,load前设置。作用于AdCompNativeAdType_View广告形式下
*/
@property (nonatomic, assign) CGSize adSize;
/*
* 初始化方法
* @param appkey 为应用id
* @param positionID 为广告位id
*/
- (instancetype)initWithAppKey:(NSString*)appkey positionID:(NSString*)positionID;
/*
* 广告加载方法
* @param count 一次请求广告的个数
*/
- (void)loadNativeAdWithCount:(int)count;
/*
* 广告view渲染完毕后即将展示调用方法(用于发送相关汇报),作用于 AdCompNativeAdType_Data 广告形式下
* @param nativeData 渲染广告的数据对象
* @param view 渲染出的广告页面
*/
- (void)showNativeAdWithData:(AdCompNativeData*)nativeData onView:(UIView*)view;
/*
* 广告点击调用的方法,作用于 AdCompNativeAdType_Data 广告形式下
* 当⽤户点击广告时,开发者需调用本方法,sdk会做出相应响应(用于发送点击汇报)
* @param nativeData 被点击的广告的数据对象
* @param point 点击坐标,广告需要用户点击坐标的位置,否则会影响收益;如果广告视图size为(300,200),左上角point值为(0,0),右下角为(300,200),以此为例计算point大小;
* @param view 渲染出的广告页面
*/
- (void)clickNativeAdWithData:(AdCompNativeData*)nativeData withClickPoint:(CGPoint)point onView:(UIView*)view;
/*
* 用于视频原生数据汇报方法,作用于 AdCompNativeAdType_Data 广告形式下
* 当触发AdCompNativeVideoStatus中某个状态时,调用该方法
* @param nativeData 当前广告使用的数据对象
* @param videoStatus 视频播放的状态
* @param dataAcquistionObj 该对象中的数据用于替换响应汇报中的宏字段,务必填写
*/
- (void)reportWithData:(AdCompNativeData*)nativeData withStatus:(AdCompNativeVideoStatus)videoStatus withDataAcquisitionObject:(AdCompNativeVideoDataAcquisitionObject*)dataAcquistionObj;
@end
//
//
// AdCompVideo.h
// KuaiYouAdHello
//
// Created by maming on 2018/8/1.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class AdCompVideo;
@protocol AdCompVideoDelegate <NSObject>
@optional
//***** ADVideoTypeInstl 应用回调
/*
* 视频可以开始播放该回调调用后可以调用showVideoWithController:展示视频广告
*/
- (void)adCompVideoIsReadyToPlay:(AdCompVideo*)video;
/*
* 视频广告播放开始回调
*/
- (void)adCompVideoPlayStarted;
/*
* 视频广告播放结束回调
*/
- (void)adCompVideoPlayEnded;
/*
* 视频广告关闭回调
*/
- (void)adCompVideoClosed;
//***** 两种模式共用部分回调
/*
* 请求广告数据成功回调
* @param vastString:贴片模式下返回视频内容字符串(vast协议标准);非贴片模式下返回为nil;
*/
- (void)adCompVideoDidReceiveAd:(NSString *)vastString;
/*
* 请求广告数据失败回调
* @param error:数据加载失败错误信息;(播放失败回调也包含再该回调中)
*/
- (void)adCompVideoFailReceiveDataWithError:(NSError*)error;
@end
typedef NS_ENUM(NSUInteger, AdCompVideoType) {
AdCompVideoTypeInstl,
AdCompVideoTypePreMovie,
};
@interface AdCompVideo : NSObject
@property (nonatomic, assign) BOOL enableGPS; // 是否打开位置信息获取功能,默认为NO;
+ (id)playVideoWithAppId:(NSString*)appId positionId:(NSString*)positionID videoType:(AdCompVideoType)videoType delegate:(id<AdCompVideoDelegate>)videoDelegate;
/**
* 设置视频展示方向
* @param orientation:视频展示方向 默认为竖屏(UIInterfaceOrientationPortrait)
*/
- (void)setInterfaceOrientations:(UIInterfaceOrientation)orientation;
/**
* 加载视频广告
*/
- (void)getVideoAD;
/**
* 设置视频背景颜色,默认为黑色,建议在showVideoWithController:方法之前使用,否则延迟生效
* @param colorString:颜色色值,例如:@“#FFFFFF”
*/
- (void)setVideoBackgroundColorWithString:(NSString*)colorString;
/**
* 展示广告,AdViewVideoIsReadyToPlay:回调之后调用,否则展示不出来(请求一次广告,只能调用一次展示广告);
*/
- (void)showVideoWithController:(UIViewController *)controller;
/**
* 清理视频缓存
*/
- (void)clearVideoBuffer;
@end
//
//
// AdCompView+Impl.h
// KuaiYouAdHello
//
// Created by adview on 13-12-23.
//
//
#import "AdCompView.h"
#define ADCOMPVIEW_SIZE_320x50 CGSizeMake(320, 50)
#define ADCOMPVIEW_SIZE_480x44 CGSizeMake(480, 44)
#define ADCOMPVIEW_SIZE_300x250 CGSizeMake(300, 250)
#define ADCOMPVIEW_SIZE_480x60 CGSizeMake(480, 60)
#define ADCOMPVIEW_SIZE_728x90 CGSizeMake(728, 90)
#define ADCOMPVIEWADPLATTYPE_ADDIRECT 0 //直投
#define ADCOMPVIEWADPLATTYPE_ADEXCHANGE 1 //交换
#define ADCOMPVIEWADPLATTYPE_SUIZONG 2 //suizong
#define ADCOMPVIEWADPLATTYPE_IMMOB 3 //Immob, server response limit
#define ADCOMPVIEWADPLATTYPE_INMOBI 4 //inmobi
#define ADCOMPVIEWADPLATTYPE_ADUU 5 //Aduu
#define ADCOMPVIEWADPLATTYPE_WQMOBILE 6 //wq
#define ADCOMPVIEWADPLATTYPE_KOUDAI 7 //koudai
#define ADCOMPVIEWADPLATTYPE_ADFILL 8 //adfill
#define ADCOMPVIEWADPLATTYPE_ADVIEW 9 //adview流量优化
#define ADCOMPVIEWADPLATTYPE_ADVIEWRTB 10 //adview RTB
@interface AdCompView (Impl)
/**
* 按尺寸请求条广告
*/
+(AdCompView*) requestOfSize:(CGSize)size withDelegate:(id<AdCompViewDelegate>)delegate
withAdPlatType:(int)adPlatType;
/**
* 请求条广告,自动适配320x50或728x90
*/
+(AdCompView*) requestWithDelegate:(id<AdCompViewDelegate>)delegate
withAdPlatType:(int)adPlatType;
/**
* 请求插屏广告
*/
+(AdCompView*) requestAdInstlWithDelegate:(id<AdCompViewDelegate>)delegate
withAdPlatType:(int)adPlatType;
/**
* 请求开屏广告
*/
+(AdCompView*) requestSpreadActivityWithDelegate:(id<AdCompViewDelegate>)delegate
withAdPlatType:(int)adPlatType;
/**
* 所对应的SDK版本
*/
+(NSString*) sdkVersion;
/**
* 展示插屏 给定一个UIViewController 用来放置插屏显示的位置
*/
- (BOOL)showWithRootViewController:(UIViewController*)rootViewController;
-(void) pauseRequestAd;
-(void) resumeRequestAd;
/**
* 清理数据缓存
*/
- (void)clearCaches;
@end
#import <UIKit/UIKit.h>
#import <CoreLocation/CLLocationManager.h>
#import "AdCompViewDelegate.h"
@interface AdCompView : UIView
@property (nonatomic, weak) id<AdCompViewDelegate> delegate;
@property (nonatomic, strong) CLLocation* location;
@property (nonatomic, strong) NSObject* adData;
@property (nonatomic, assign) BOOL isReady; //插屏是否注备好
@end
//
//
// AdCompViewDelegate.h
// KuaiYouAdHello
//
// Created by adview on 13-12-12.
//
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CLLocationManager.h>
//开屏位置 1居上 2居下
typedef enum{
AdCompSpreadShowTypeTop = 1,
AdCompSpreadShowTypeBottom = 2,
}AdCompSpreadShowType;
@class AdCompView;
@protocol AdCompViewDelegate <NSObject>
@optional
- (NSString*)appPwd;
/**
* 设置小程序广告应用绑定相关微信开发者ID,不提供developerId的话不返回小程序广告
*/
- (NSString*)miniProgramAdDeveloperId;
- (UIColor*)adTextColor;
- (UIColor*)adBackgroundColor;
- (NSString*)adBackgroundImgName;
- (NSString*)logoImgName;//开屏logo图片的名字;
- (BOOL)usingSKStoreProductViewController;//是否使用应用内打开AppStore
/**
* 广告请求成功
*/
- (void)didReceivedAd:(AdCompView*)adView reuse:(BOOL)isReuse;
/**
* 广告请求失败
*/
- (void)didFailToReceiveAd:(AdCompView*)adView Error:(NSError*)error;
/**
* 插屏预备好回调
*/
- (void)adinstlDidReadyToShow:(AdCompView*)adView;
- (NSString*)AdCompViewHost;
- (int)autoRefreshInterval; //<=0 - none, <15 - 15, unit: seconds
- (int)gradientBgType; //-1 - none, 0 - fix, 1 - random
- (UIViewController*)viewControllerForShowModal;
/**
* 广告网页将要展示回调
*/
- (void)adViewWillPresentScreen:(AdCompView *)adView;
/**
* 广告网页将要关闭回调
*/
- (void)adViewDidDismissScreen:(AdCompView *)adView;
/*
* 广告点击之后应用进入后台时回调
*/
- (void)adViewResignActive:(AdCompView *)adView;
/**
* 插屏/开屏关闭回调
*/
- (void)adInstlDidDismissScreen:(AdCompView *)adInstl;
/**
* 是否为测试模式
*/
- (BOOL)testMode;
/**
* 是否使用缓存
*/
- (BOOL)usingCache;
/**
* 是否打印日志
*/
- (BOOL)logMode;
- (int)configVersion;
/**
* 获取 location 信息
*/
- (CLLocation*)getLocation;
/**
* 有些开发者需要展示广告的位置变动 默认为屏幕中心 例子: return 20 即广告中心点向上移动 20
*/
- (float)moveCentr;
/**
* 等比例缩放 有限制范围为 0.8 - 1.2 之间
*/
- (float)scaleProportion;
/**
* wkwebview需要提前添加到视图
*/
- (void)needPreAddView:(AdCompView *)adview;
@required
- (NSString*)appId;
@end
//
//
// BaiduMobAdSDK
//
// Created by lishan04 on 16/7/11.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdBaseNativeAdView;
@protocol BaiduMobAdBaseNativeAdDelegate <NSObject>
@required
/**
* 应用在union.baidu.com上的APPID
*/
- (NSString *)publisherId;
/**
* 广告位id
*/
-(NSString*)apId;
@optional
/**
* 渠道ID
*/
- (NSString *)channelId;
/**
* 启动位置信息
*/
-(BOOL) enableLocation;//如果enable,plist 需要增加NSLocationWhenInUseUsageDescription
/**
* 广告请求成功
* @param 请求成功的AdObject数组,如果只成功返回一条广告,数组大小为1
*/
- (void)onAdObjectsSuccessLoad:(NSArray*)adsArray;
/**
* 广告请求失败
* @param 失败的类型 BaiduMobFailReason
*/
- (void)onAdsFailLoad:(BaiduMobFailReason) reason;
/**
* 广告点击
*/
- (void)onAdClicked:(BaiduMobAdBaseNativeAdView*)adView;
/**
* 广告详情页关闭
*/
-(void)didDismissLandingPage:(BaiduMobAdBaseNativeAdView *)adView;
@end
//
//
// BaiduMobAdNativeAdObject.h
// BaiduMobNativeSDK
//
// Created by lishan04 on 15-5-26.
// Copyright (c) 2015年 lishan04. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@interface BaiduMobAdBaseNativeAdObject: NSObject
@end
//
//
// BaiduMobAdBaseNativeAdView.h
// BaiduMobAdSDK
//
// Created by lishan04 on 16/11/4.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BaiduMobAdBaseNativeAdView : UIView
@end
//
//
// BaiduMobAdCommonConfig.h
// BaiduMobAdSdk
//
// Created by dengjinxiang on 13-8-22.
//
//
#import <UIKit/UIKit.h>
#ifndef BaiduMobAdSdk_BaiduMobAdCommonConfig_h
#define BaiduMobAdSdk_BaiduMobAdCommonConfig_h
// SDK版本号
#define SDK_VERSION_IN_MSSP @"4.65"
typedef void (^BaiduMobAdViewCompletionBlock)(NSArray *errors);
typedef enum {
NORMAL, // 一般图文或图片广告
VIDEO, // 视频广告,需开发者增加播放器支持
HTML, // html模版广告
GIF //GIF广告
} BaiduMobMaterialType;
typedef enum {
BaiduMobNativeAdActionTypeLP = 1,
BaiduMobNativeAdActionTypeDL = 2
} BaiduMobNativeAdActionType;
typedef enum {
onShow, //video展现
onClickToPlay,//点击播放
onStart, //开始播放
onError, //播放失败
onComplete, //完整播放
onClose, //播放结束
onFullScreen, //全屏观看
onClick, //广告点击
onSkip, //跳过视频
onShowEndCard,// 展现endcard
onClickEndCard,// 点击endcard
onClickDownloadDirect, // 视频下载广告点击直接下载
onCacheSuccess,//视频缓存成功
onCacheFail,//视频缓存失败
onCacheExpire//广告过期
} BaiduAdNativeVideoEvent;
/**
* 性别类型
*/
typedef enum {
BaiduMobAdMale = 0,
BaiduMobAdFeMale = 1,
BaiduMobAdSexUnknown = 2,
} BaiduMobAdUserGender;
/**
* 广告展示失败类型枚举
*/
typedef enum _BaiduMobFailReason {
BaiduMobFailReason_NOAD = 0,// 没有推广返回
BaiduMobFailReason_EXCEPTION,//网络或其它异常
BaiduMobFailReason_FRAME//广告尺寸或元素异常,不显示广告
} BaiduMobFailReason;
/**
* Landpage页面导航栏颜色设置
*/
typedef enum {
BaiduMobAdLpStyleDefault,
BaiduMobAdLpStyleRed,
BaiduMobAdLpStyleGreen,
BaiduMobAdLpStyleBrown,
BaiduMobAdLpStyleDarkBlue,
BaiduMobAdLpStyleLightBlue,
BaiduMobAdLpStyleBlack
} BaiduMobAdLpStyle;
/**
* 内容联盟频道id列表
* 仅适用于频道样式
* block样式需要开发者自己在mssp申请id
*/
#define CPU_CHANNEL_ENTERTAINMENT @"1001" //娱乐
#define CPU_CHANNEL_SPORTS @"1002" //体育
#define CPU_CHANNEL_PICTURE @"1003" //图片
#define CPU_CHANNEL_MOBILE @"1005" //手机
#define CPU_CHANNEL_FINANCE @"1006" //财经
#define CPU_CHANNEL_CAR @"1007" //汽车
#define CPU_CHANNEL_HOUSE @"1008" //房产
#define CPU_CHANNEL_FASHION @"1009" //时尚
#define CPU_CHANNEL_SHOPPING @"1010" //购物
#define CPU_CHANNEL_MILITARY @"1012" //军事
#define CPU_CHANNEL_TECH @"1013" //科技
#define CPU_CHANNEL_HEALTH @"1014" //健康
#define CPU_CHANNEL_HOTSPOT @"1021" //热点
#define CPU_CHANNEL_RECOMMEND @"1022" //推荐
#define CPU_CHANNEL_BEAUTY @"1024" //美女
#define CPU_CHANNEL_AMUSE @"1025" //搞笑
#define CPU_CHANNEL_AGG @"1032" //聚合
#define CPU_CHANNEL_VIDEO @"1033" //视频
#define CPU_CHANNEL_WOMEN @"1034" //女人
#define CPU_CHANNEL_LIFE @"1035" //生活
#define CPU_CHANNEL_CULTURE @"1036" //文化
#endif
//
//
// BaiduMobAdDelegateProtocol.h
// BaiduMobAdSdk
//
// Created by jaygao on 11-9-8.
// Copyright 2011年 Baidu. All rights reserved.
//
//
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdView;
/**
* 广告sdk委托协议
*/
@protocol BaiduMobAdViewDelegate <NSObject>
@required
/**
* 应用的APPID
*/
- (NSString *)publisherId;
@optional
/**
* 渠道ID
*/
- (NSString *)channelId;
/**
* 启动位置信息
*/
- (BOOL)enableLocation;
/**
* 广告将要被载入
*/
- (void)willDisplayAd:(BaiduMobAdView *)adview;
/**
* 广告载入失败
*/
- (void)failedDisplayAd:(BaiduMobFailReason)reason;
/**
* 本次广告展示成功时的回调
*/
- (void)didAdImpressed;
/**
* 本次广告展示被用户点击时的回调
*/
- (void)didAdClicked;
/**
* 在用户点击完广告条出现全屏广告页面以后,用户关闭广告时的回调
*/
- (void)didDismissLandingPage;
/**
* 用户点击关闭按钮关闭广告后的回调
*/
- (void)didAdClose;
@end
//
//
// BaiduMobAdHybridAdManager.h
// XAdSDKDevSample
//
// Created by lishan04 on 09/04/2018.
// Copyright © 2018 Baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@protocol BaiduMobAdHybridAdManagerDelegate <NSObject>
@optional
/**
* 广告展示失败
*/
- (void)failedDisplayAd;
/**
* 广告展示成功
*/
- (void)didAdImpressed;
/**
* 广告点击
*/
- (void)didAdClicked;
@end
@interface BaiduMobAdHybridAdManager: NSObject
@property (nonatomic, copy) NSString *publisherId;
@property (nonatomic, weak) id <BaiduMobAdHybridAdManagerDelegate> delegate;
//重要,把wkwebview传给BaiduMobAdHybridAdManager进行注册
- (void)injectJavaScriptBridgeForWKWebView:(WKWebView *)webview;
- (void)injectJavaScriptBridgeForUIWebView:(UIWebView *)webview;
//重要,在wkwebview回调时通知BaiduMobAdHybridAdManager,返回是否继续加载
- (BOOL)webView:(WKWebView *)webView shouldStartLoadForNavigationAction:(WKNavigationAction *)navigationAction;
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
@end
//
//
// BaiduMobAdInterstitial.h
// BaiduMobAdSDK
//
// Created by LiYan on 16/4/13.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdInterstitialDelegate.h"
/*
* 5 插屏广告:其他场景中使用 BaiduMobAdViewTypeInterstitialOther
* 7 插屏广告:视频图片前贴片 BaiduMobAdViewTypeInterstitialBeforeVideo 有倒计时5s
* 8 插屏广告:视频暂停贴片 BaiduMobAdViewTypeInterstitialPauseVideo 没有倒计时
*/
typedef enum _BaiduMobAdInterstitialType {
BaiduMobAdViewTypeInterstitialOther = 5,
BaiduMobAdViewTypeInterstitialBeforeVideo = 7,
BaiduMobAdViewTypeInterstitialPauseVideo = 8
} BaiduMobAdInterstitialType;
@interface BaiduMobAdInterstitial : NSObject
/**
* 委托对象
*/
@property (nonatomic ,weak) id<BaiduMobAdInterstitialDelegate> delegate;
/**
* 插屏广告类型
*/
@property (nonatomic) BaiduMobAdInterstitialType interstitialType;
/**
* 插屏广告是否准备好
*/
@property (nonatomic) BOOL isReady;
/**
* 设置/获取代码位id
*/
@property (nonatomic,copy) NSString* AdUnitTag;
/**
* SDK版本
*/
@property (nonatomic, readonly) NSString* Version;
/**
* 使用controller present 落地页
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
/**
* 实时加载并显示插屏广告.会卡住约两秒钟,影响用户体验,不建议使用.
*/
- (void)loadAndDisplayUsingKeyWindow:(UIWindow *)keyWindow;
/**
* 加载插屏广告
*/
- (void)load;
/**
* 展示插屏广告
*/
- (void)presentFromRootViewController:(UIViewController *)rootViewController;
/**
* 加载自定义大小的插屏,必须大于100*150
*/
- (void)loadUsingSize:(CGRect)rect;
/**
* 展示自定义大小的插屏
*/
- (void)presentFromView:(UIView *)view;
@end
//
//
// BaiduMobAdInterstitialDelegate.h
// XAdSDKDevSample
//
// Created by LiYan on 16/4/13.
// Copyright © 2016年 Baidu. All rights reserved.
//
#import "BaiduMobAdCommonConfig.h"
#import <Foundation/Foundation.h>
@class BaiduMobAdInterstitial;
@protocol BaiduMobAdInterstitialDelegate <NSObject>
@required
/**
* appid
*/
- (NSString *)publisherId;
@optional
/**
* channel id
*/
- (NSString *)channelId;
/**
* location
*/
- (BOOL) enableLocation;
/**
* 广告预加载成功
*/
- (void)interstitialSuccessToLoadAd:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告预加载失败
*/
- (void)interstitialFailToLoadAd:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告即将展示
*/
- (void)interstitialWillPresentScreen:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告展示成功
*/
- (void)interstitialSuccessPresentScreen:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告展示失败
*/
- (void)interstitialFailPresentScreen:(BaiduMobAdInterstitial *)interstitial withError:(BaiduMobFailReason) reason;
/**
* 广告展示被用户点击时的回调
*/
- (void)interstitialDidAdClicked:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告展示结束
*/
- (void)interstitialDidDismissScreen:(BaiduMobAdInterstitial *)interstitial;
/**
* 广告详情页被关闭
*/
- (void)interstitialDidDismissLandingPage:(BaiduMobAdInterstitial *)interstitial;
@end
//
//
// BaiduMobAdNative.h
// BaiduMobAdSdk
//
// Created by lishan04 on 15-1-8.
//
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdNativeAdDelegate.h"
@class BaiduMobAdNativeAdView;
@interface BaiduMobAdNative : NSObject
/**
* 应用的APPID
*/
@property(nonatomic, copy) NSString *publisherId;
/**
* 设置/获取代码位id
*/
@property(nonatomic, copy) NSString *adId;
/**
* 原生广告delegate
*/
@property (nonatomic ,weak) id<BaiduMobAdNativeAdDelegate> delegate;
/**
* 针对视频缓存delegate
* 适用于小视频,信息流视频不建议使用
*/
@property (nonatomic ,weak) id<BaiduMobAdNativeCacheDelegate> cacheDelegate;
/**
* 模版高度,仅用于信息流模版广告
*/
@property (nonatomic ,retain) NSNumber *baiduMobAdsHeight ;
/**
* 模版宽度,仅用于信息流模版广告
*/
@property (nonatomic ,retain) NSNumber *baiduMobAdsWidth ;
/**
* 使用controller present 落地页
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
/**
* 请求原生广告
* 注意广告的展示存在有效期,单次检索后须在一定时间内展示在页面上
*/
- (void)requestNativeAds;
@end
//
//
// BaiduMobAdInterstitialDelegate.h
// BaiduMobAdWebSDK
//
// Created by deng jinxiang on 13-8-1.
//
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdNative;
@class BaiduMobAdNativeAdView;
@protocol BaiduMobAdNativeAdDelegate <NSObject>
@optional
/**
* 应用在mssp.baidu.com上的APPID
*/
- (NSString *)publisherId;
/**
* 广告位id
*/
- (NSString*)apId;
/**
* 模版高度,仅用于信息流模版广告
*/
- (NSNumber*)baiduMobAdsHeight;
/**
* 模版宽度,仅用于信息流模版广告
*/
- (NSNumber*)baiduMobAdsWidth;
/**
* 渠道ID
*/
- (NSString *)channelId;
/**
* 启动位置信息
*/
- (BOOL) enableLocation;//如果enable,plist 需要增加NSLocationWhenInUseUsageDescription
/**
* 广告请求成功
* @param 请求成功的BaiduMobAdNativeAdObject数组,如果只成功返回一条原生广告,数组大小为1
*/
- (void)nativeAdObjectsSuccessLoad:(NSArray *)nativeAds;
/**
* 广告请求失败
* @param 失败的BaiduMobAdNative
* @param 失败的类型 BaiduMobFailReason
*/
- (void)nativeAdsFailLoad:(BaiduMobFailReason) reason;
/**
* 广告点击
*/
- (void)nativeAdClicked:(UIView *)nativeAdView;
/**
* 广告详情页关闭
*/
- (void)didDismissLandingPage:(UIView *)nativeAdView;
@end
#pragma mark - 视频缓存delegate
@protocol BaiduMobAdNativeCacheDelegate <NSObject>
@optional
/**
* 视频缓存成功
*/
- (void)nativeVideoAdCacheSuccess:(BaiduMobAdNative *)nativeAd;
/**
* 视频缓存失败
*/
- (void)nativeVideoAdCacheFail:(BaiduMobAdNative *)nativeAd withError:(BaiduMobFailReason)reason;
@end
//
//
// BaiduMobAdNativeAdObject.h
// BaiduMobNativeSDK
//
// Created by lishan04 on 15-5-26.
// Copyright (c) 2015年 lishan04. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@interface BaiduMobAdNativeAdObject: NSObject
/**
* 标题 text
*/
@property (copy, nonatomic) NSString *title;
/**
* 描述 text
*/
@property (copy, nonatomic) NSString *text;
/**
* 小图 url
*/
@property (copy, nonatomic) NSString *iconImageURLString;
/**
* 大图 url
*/
@property (copy, nonatomic) NSString *mainImageURLString;
/**
* 广告标识图标 url
*/
@property (copy, nonatomic) NSString *adLogoURLString;
/**
* 百度logo图标 url
*/
@property (copy, nonatomic) NSString *baiduLogoURLString;
/**
* 多图信息流的image url array
*/
@property (strong, nonatomic) NSArray *morepics;
/**
* 视频url
*/
@property (copy, nonatomic) NSString *videoURLString;
/**
* 视频时长,单位为s
*/
@property (copy, nonatomic) NSNumber *videoDuration;
/**
* 品牌名称,若广告返回中无品牌名称则为空
*/
@property (copy, nonatomic) NSString *brandName;
/**
* 自动播放
*/
@property (copy, nonatomic) NSNumber *autoPlay;
/**
* 开发者配置可接受视频后,对返回的广告单元,需先判断BaiduMobMaterialType再决定使用何种渲染组件
*/
@property BaiduMobMaterialType materialType;
/**
* 返回广告单元的点击类型
*/
@property (nonatomic) BaiduMobNativeAdActionType actType;
/**
* 大图图片宽
*/
@property (copy, nonatomic) NSString *w;
/**
* 大图图片高
*/
@property (copy, nonatomic) NSString *h;
/**
* 是否过期,默认为false,30分钟后过期,需要重新请求广告
*/
-(BOOL) isExpired;
/**
* 可以不传
*/
@property (nonatomic, assign) UIViewController *presentAdViewController;
//#warning 重要,一定要调用这个方法发送视频状态事件和当前视频播放的位置
/**
* 发送视频广告相关日志
* @param currentPlaybackTime 播放器当前时间,单位为s
*/
- (void)trackVideoEvent:(BaiduAdNativeVideoEvent)event withCurrentTime:(NSTimeInterval)currentPlaybackTime;
/**
* 发送展现
*/
- (void)trackImpression:(UIView *)view;
/**
* 发送点击
*/
-(void)handleClick:(UIView*)view;
@end
//
//
// BaiduMobAdNativeAdView.h
// BaiduMobAdSdk
//
// Created by lishan04 on 15-1-6.
//
//
#import <UIKit/UIKit.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdNativeVideoBaseView;
@class BaiduMobAdNativeAdObject;
@class BaiduMobAdNativeWebView;
@interface BaiduMobAdNativeAdView : UIView
/**
* 初始化,非视频信息流,BaiduMobMaterialType是NORMAL的初始化方法
* 添加品牌名称brandName
*/
-(id)initWithFrame:(CGRect)frame
brandName:(UILabel *) brandLabel
title:(UILabel *) titleLabel
text:(UILabel *) textLabel
icon:(UIImageView *) iconView
mainImage:(UIImageView *) mainView;
/**
* 如果BaiduMobMaterialType是VIDEO的初始化方法
* 添加品牌名称brandName
1.开发者可用百度自带播放器组建BaiduMobAdNativeVideoView渲染,并传入视频view
2.开发者可使用自己的视频播放控件渲染,并传入视频view
*/
-(id)initWithFrame:(CGRect)frame
brandName:(UILabel *) brandLabel
title:(UILabel *) titleLabel
text:(UILabel *) textLabel
icon:(UIImageView *) iconView
mainImage:(UIImageView *) mainView
videoView:(BaiduMobAdNativeVideoBaseView *) videoView;
/**
* 如果BaiduMobMaterialType是HTML的初始化方法
*/
-(id)initWithFrame:(CGRect)frame
webview:(BaiduMobAdNativeWebView *) webView;
/**
* 小图
*/
@property (strong, nonatomic) UIImageView *iconImageView;
/**
* 大图
*/
@property (strong, nonatomic) UIImageView *mainImageView;
/**
* 广告标示
*/
@property (strong, nonatomic) UIImageView *adLogoImageView;
/**
* 百度广告logo
*/
@property (strong, nonatomic) UIImageView *baiduLogoImageView;
/**
* 标题 view
*/
@property (strong, nonatomic) UILabel *titleLabel;
/**
* 描述 view
*/
@property (strong, nonatomic) UILabel *textLabel;
/**
* 品牌名称 view
*/
@property (strong, nonatomic) UILabel *brandLabel;
/**
* 视频 view
*/
@property (strong, nonatomic) BaiduMobAdNativeVideoBaseView *videoView;
/**
* web view
*/
@property (strong, nonatomic) BaiduMobAdNativeWebView *webView;
/**
* 展示用的vc, 可以不传
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
/**
* 根据BaiduMobAdNativeAdObject广告内容,在广告视图上缓存和展示广告,同时关联广告视图和点击展现行为
* object 包含文字内容和物料地址
*/
- (void)loadAndDisplayNativeAdWithObject:(BaiduMobAdNativeAdObject *)object completion:(BaiduMobAdViewCompletionBlock)completionBlock;
- (void)trackImpression;
- (BOOL)render;
+ (void)dealTapGesture:(BOOL) deal;
@end
//
//
// BaiduMobAdNativeVideoBaseView.h
// BaiduMobAdNativeSDKSample
//
// Created by lishan04 on 15/11/16.
// Copyright © 2015年 lishan04. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BaiduMobAdCommonConfig.h"
//自定义视频播放器需要实现的接口
@interface BaiduMobAdNativeVideoBaseView : UIView
- (BOOL)isPlaying;
- (void)play;
- (void)pause;
- (void)stop;
- (BOOL)render;
- (BOOL)handleScrollStop;
#warning 重要,一定要向BaiduMobAdNativeAdObject发送视频状态事件和当前视频播放的位置,只有在第一次播放才需要发送
- (void)sendVideoEvent:(BaiduAdNativeVideoEvent)event currentTime:(NSTimeInterval) currentTime;
@end
//
//
//
// Created by lishan04 on 15-11-1.
// Copyright (c) 2015 lishan04. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BaiduMobAdCommonConfig.h"
#import "BaiduMobAdNativeVideoBaseView.h"
@class BaiduMobAdNativeAdObject;
@interface BaiduMobAdNativeVideoView : BaiduMobAdNativeVideoBaseView
@property BOOL supportControllerView;
@property BOOL supportActImage;
#define VideoViewAyyay [[NSMutableArray alloc] initWithCapacity:5];
@property (nonatomic, retain) UIButton *btnLP;//点击查看详情按钮
@property (nonatomic, retain) UIButton *btnReplay;//重播按钮
// 初始化方法,需要传入广告返回的BaiduMobAdNativeAdObject
- (instancetype)initWithFrame:(CGRect)frame andObject:(BaiduMobAdNativeAdObject *)object;
- (void)play;
- (void)pause;
- (void)stop;
- (BOOL)render;
- (BOOL)handleScrollStop;
- (BOOL)isPlaying;
#warning 重要,一定要向BaiduMobAdNativeAdObject发送视频状态事件和当前视频播放的位置,只有在第一次播放才需要发送
- (void)sendVideoEvent:(BaiduAdNativeVideoEvent)event currentTime:(NSTimeInterval) currentTime;
@end
//
//
// BaiduMobAdNativeWebView.h
// BaiduMobNativeSDK
//
// Created by lishan04 on 15/11/17.
// Copyright © 2015年 lishan04. All rights reserved.
//
#import <UIKit/UIKit.h>
@class BaiduMobAdNativeAdObject;
@interface BaiduMobAdNativeWebView : UIWebView
- (instancetype)initWithFrame:(CGRect)frame andObject:(BaiduMobAdNativeAdObject *)object;
@end
//
//
// BaiduMobAdPreroll.h
// BaiduMobAdSDK
//
// Created by Yang,Dingjia on 2019/3/25.
// Copyright © 2019 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BaiduMobAdPrerollDelegate.h"
@interface BaiduMobAdPreroll : NSObject
/**
* 委托对象
*/
@property (nonatomic ,weak) id<BaiduMobAdPrerollDelegate> delegate;
/**
* 应用的APPID
*/
@property(nonatomic, copy) NSString *publisherId;
/**
* 设置/获取代码位id
*/
@property(nonatomic, copy) NSString *adId;
/**
* 设置贴片baseview
*/
@property(nonatomic, strong) UIView *renderBaseView;
/**
* 位置信息
*/
@property (nonatomic, assign) BOOL enableLocation;
/**
设置静音(默认非静音)
@param mute YES静音 NO非静音
*/
@property (nonatomic, assign) BOOL mute;
/**
* 使用controller present 落地页
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
/**
* 请求广告
*/
- (void)load;
/**
* 关闭广告(stop视频,普通广告请remove)
*/
- (void)close;
/**
当前播放时长
@return 视频播放时长
*/
- (NSTimeInterval)currentTime;
/**
视频总时长
@return 视频总时长
*/
- (NSTimeInterval)duration;
/**
* 对返回的广告单元,需先判断BaiduMobMaterialType再决定使用何种渲染组件
*/
- (NSString *)adMaterialType;
@end
//
//
// BaiduMobAdPrerollDelegate.h
// BaiduMobAdSdk
//
// Created by lishan04 on 15-6-8.
//
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdPreroll;
@protocol BaiduMobAdPrerollDelegate <NSObject>
@optional
/**
* 加载成功
@param adMaterialType BaiduMobMaterialType
*/
- (void)prerollAdloadSuccess:(BaiduMobAdPreroll *)preroll withAdMaterialType:(NSString *)adMaterialType;
/**
* 展示成功
*/
- (void)prerollAdDidStart:(BaiduMobAdPreroll *)preroll;
/**
* 广告展示失败
*/
- (void)prerollAdDidFailed:(BaiduMobAdPreroll *)preroll withError:(BaiduMobFailReason) reason;
/**
* 广告展示结束
*/
- (void)prerollAdDidFinish:(BaiduMobAdPreroll *)preroll;
/**
* 广告点击
*/
- (void)prerollAdDidClicked:(BaiduMobAdPreroll *)preroll;
@end
//
//
// BaiduMobAdRewardVideo.h
// BaiduMobAdSDK
//
// Created by Yang,Dingjia on 2018/7/3.
// Copyright © 2018年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdRewardVideoDelegate.h"
@interface BaiduMobAdRewardVideo : NSObject
/**
* 委托对象
*/
@property (nonatomic, weak) id <BaiduMobAdRewardVideoDelegate> delegate;
/**
* 应用的APPID
*/
@property (nonatomic, copy) NSString *publisherId;
/**
* 设置/获取代码位(广告位)id
*/
@property (nonatomic, copy) NSString *AdUnitTag;
/**
* 启动位置信息 如果enable,plist 需要增加NSLocationWhenInUseUsageDescription
*/
@property (nonatomic, assign) BOOL enableLocation;
/**
* 预加载视频广告,并缓存物料信息到本地。
* 注意广告的展示存在有效期,单次检索后须在一定时间内展示在页面上
*/
- (void)load;
/**
* 激励视频广告的展示存在有效期,单次检索后须在一定时间内展示在页面上
* 返回本地是否有可用广告 YES代表本地有缓存成功且未过期的广告,NO代表不可用
*/
- (BOOL)isReady;
/**
* 展示激励视频,默认RootViewController present
* 默认使用本地缓存,本地缓存失效则在线请求
*/
- (void)show;
/**
* 展示激励视频,使用controller present
* 默认使用本地缓存,本地缓存失效则在线请求
*/
- (void)showFromViewController:(UIViewController *)controller;
@end
//
//
// BaiduMobAdRewardVideoDelegate.h
// BaiduMobAdSDK
//
// Created by Yang,Dingjia on 2018/7/3.
// Copyright © 2018年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdRewardVideo;
@protocol BaiduMobAdRewardVideoDelegate <NSObject>
@optional
#pragma mark - 视频缓存delegate
/**
* 视频缓存成功
*/
- (void)rewardedVideoAdLoaded:(BaiduMobAdRewardVideo *)video;
/**
* 视频缓存失败
*/
- (void)rewardedVideoAdLoadFailed:(BaiduMobAdRewardVideo *)video withError:(BaiduMobFailReason)reason;
#pragma mark - 视频播放delegate
/**
* 视频开始播放
*/
- (void)rewardedVideoAdDidStarted:(BaiduMobAdRewardVideo *)video;
/**
* 广告展示失败
*/
- (void)rewardedVideoAdShowFailed:(BaiduMobAdRewardVideo *)video withError:(BaiduMobFailReason)reason;
/**
* 广告完成播放
*/
- (void)rewardedVideoAdDidPlayFinish:(BaiduMobAdRewardVideo *)video;
/**
* 用户点击关闭
@param progress 当前播放进度 单位百分比 (注意浮点数)
*/
- (void)rewardedVideoAdDidClose:(BaiduMobAdRewardVideo *)video withPlayingProgress:(CGFloat)progress;
/**
* 用户点击下载/查看详情
@param progress 当前播放进度 单位百分比
*/
- (void)rewardedVideoAdDidClick:(BaiduMobAdRewardVideo *)video withPlayingProgress:(CGFloat)progress;
@end
//
//
// BaiduMobAdWebSDK
//
//
//
#import <UIKit/UIKit.h>
#import "BaiduMobAdCommonConfig.h"
@interface BaiduMobAdSetting : NSObject
@property BOOL supportHttps;
@property BOOL trackCrash;
/**
* 设置Landpage页面导航栏颜色
*/
+ (void)setLpStyle:(BaiduMobAdLpStyle)style;
+ (BaiduMobAdSetting *)sharedInstance;
/**
* 设置视频缓存阀值,单位M, 取值范围15M-100M,默认30M
*/
+ (void)setMaxVideoCacheCapacityMb:(NSInteger)capacity;
@end
//
//
// BaiduMobAdSplash.h
// BaiduMobAdSDK
//
// Created by LiYan on 16/5/25.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BaiduMobAdSplashDelegate.h"
@interface BaiduMobAdSplash : NSObject
/**
* 委托对象
*/
@property (nonatomic ,weak) id<BaiduMobAdSplashDelegate> delegate;
/**
* 设置/获取代码位id
*/
@property (nonatomic,copy) NSString* AdUnitTag;
/**
* 设置开屏广告是否可以点击的属性,开屏默认可以点击。
*/
@property (nonatomic) BOOL canSplashClick;
/**
* SDK版本
*/
@property (nonatomic, readonly) NSString* Version;
/**
* 应用启动时展示开屏广告
*/
- (void)loadAndDisplayUsingKeyWindow:(UIWindow *)keyWindow;
/**
* 应用启动时展示半屏开屏广告
*/
- (void)loadAndDisplayUsingContainerView:(UIView *)view;
/**
* 使用controller present 落地页
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
@end
//
//
// BaiduMobAdSplashDelegate.h
// BaiduMobAdSDK
//
// Created by LiYan on 16/5/25.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import "BaiduMobAdCommonConfig.h"
#import <Foundation/Foundation.h>
@class BaiduMobAdSplash;
@protocol BaiduMobAdSplashDelegate <NSObject>
@required
/**
* 应用的APPID
*/
- (NSString *)publisherId;
@optional
/**
* 渠道id
*/
- (NSString*) channelId;
/**
* 启动位置信息
*/
-(BOOL) enableLocation;
/**
* 广告展示成功
*/
- (void)splashSuccessPresentScreen:(BaiduMobAdSplash *)splash;
/**
* 广告展示失败
*/
- (void)splashlFailPresentScreen:(BaiduMobAdSplash *)splash withError:(BaiduMobFailReason) reason;
/**
* 广告被点击
*/
- (void)splashDidClicked:(BaiduMobAdSplash *)splash;
/**
* 广告展示结束
*/
- (void)splashDidDismissScreen:(BaiduMobAdSplash *)splash;
/**
* 广告详情页消失
*/
- (void)splashDidDismissLp:(BaiduMobAdSplash *)splash;
/**
* 广告加载完成
* adType:广告类型 BaiduMobMaterialType
* videoDuration:视频时长,仅广告为视频时出现。非视频类广告默认0。 单位ms
*/
- (void)splashDidReady:(BaiduMobAdSplash *)splash
AndAdType:(NSString *)adType
VideoDuration:(NSInteger)videoDuration;
@end
//
//
// BaiduMobAdCustomVideoView.h
// BaiduMobAdSDK
//
// Created by Yang,Dingjia on 2018/11/13.
// Copyright © 2018 Baidu Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BaiduMobAdCommonConfig.h"
@class BaiduMobAdVideoView;
@protocol BaiduMobAdVideoViewDelegate <NSObject>
@optional
/**
视频准备开始播放(首帧)
@param videoView self
*/
- (void)fullscreenVideoAdDidStartPlaying:(BaiduMobAdVideoView *)videoView;
/**
视频播放完成
@param videoView self
*/
- (void)fullscreenVideoAdDidComplete:(BaiduMobAdVideoView *)videoView;
/**
视频播放失败
@param videoView self
*/
- (void)fullscreenVideoAdDidFailed:(BaiduMobAdVideoView *)videoView;
/**
视频发生点击
@param videoView self
*/
- (void)fullscreenVideoAdDidClick:(BaiduMobAdVideoView *)videoView;
@end
@interface BaiduMobAdVideoView : UIView
@property (nonatomic, weak) id <BaiduMobAdVideoViewDelegate> delegate;
/**
* 广告素材type
*/
@property (nonatomic, assign) BaiduMobMaterialType materialType;
/**
初始化方法
@param frame videoView尺寸
@param object BaiduMobAdNativeAdObject
@return BaiduMobAdVideoView
*/
- (instancetype)initWithFrame:(CGRect)frame andObject:(id)object;
/**
开始播放
*/
- (void)play;
/**
重新播放
*/
- (void)replay;
/**
暂停播放
*/
- (void)pause;
/**
销毁播放器
*/
- (void)stop;
/**
设置静音
@param mute YES静音 NO非静音
*/
- (void)setVideoMute:(BOOL)mute;
/**
是否播放中
@return isPlaying
*/
- (BOOL)isPlaying;
/**
当前播放时间
@return 当前播放时间
*/
- (NSTimeInterval)currentTime;
/**
视频总时长
@return 视频总时长
*/
- (NSTimeInterval)duration;
#pragma mark - 计费相关视频事件 重要!
/**
视频点击事件 点击计费接口
*/
- (void)handleClick;
/**
视频曝光事件 已废弃,无需开发者发送
*/
- (void)trackImpression DEPRECATED_MSG_ATTRIBUTE("已废弃,无需开发者发送");
@end
//
//
// BaiduMobAdView.h
// BaiduMobAdSdk
//
// Created by jaygao on 11-9-6.
// Copyright 2011年 Baidu. All rights reserved.
//
//
#import "BaiduMobAdDelegateProtocol.h"
#import <UIKit/UIKit.h>
/**
* 投放广告的视图接口,更多信息请查看[百度移动联盟主页](http://mssp.baidu.com)
*/
/**
* 广告类型
* 0 banner广告
*/
typedef enum _BaiduMobAdViewType {
BaiduMobAdViewTypeBanner = 0
} BaiduMobAdViewType;
@interface BaiduMobAdView : UIView
/**
* 委托对象
*/
@property(nonatomic, weak) id<BaiduMobAdViewDelegate> delegate;
/**
* 设置/获取需要展示的广告类型
*/
@property(nonatomic) BaiduMobAdViewType AdType;
/**
* 设置/获取代码位id
*/
@property(nonatomic, copy) NSString *AdUnitTag;
/**
* SDK版本
*/
@property(nonatomic, readonly) NSString *Version;
/**
* 使用controller present 落地页
*/
@property (nonatomic, strong) UIViewController *presentAdViewController;
/**
* 开始广告展示请求,会触发所有资源的重新加载,推荐初始化以后调用一次
*/
- (void)start;
@end
//
//
// BaiduMobCpuInfoManager.h
// BaiduMobNativeSDK
//
// Created by JK.PENG on 16/5/4.
// Copyright © 2016年 lishan04. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BaiduMobCpuInfoManager : NSObject
+ (BaiduMobCpuInfoManager *)shared;
/**
* 返回媒体URL
*
* @param channelId 频道ID
* @param appId 应用ID
* 说明:
*/
- (NSString *)getCpuInfoUrlWithChannelId:(NSString *)channelId
appId:(NSString *)appId;
@end
2015.07.27
2015.07.27
*****3.1.8*****
1.广告sdk完成支持banner/插屏/开屏类型广告。
2015.10.08
*****3.1.9*****
1.修改成https
**项目框架更改为ARC模式,非ARC模式下请为相关文件添加 -fobjc-arc 标签。
**项目框架更改为ARC模式,非ARC模式下请为相关文件添加 -fobjc-arc 标签。
**在项目设置中设置Other Linker Flags的值,该值为“-ObjC”。
\ No newline at end of file
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