Commit 6f9c574f authored by Mazy's avatar Mazy

Merge remote-tracking branch 'refs/remotes/origin/master'

parents bf81068f f960725e
...@@ -281,14 +281,14 @@ ...@@ -281,14 +281,14 @@
64F89670255FABB800AF9AD7 /* platform */ = { 64F89670255FABB800AF9AD7 /* platform */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
64F89671255FABB800AF9AD7 /* AddCSJADManager.h */,
64F89675255FABB800AF9AD7 /* AddCSJADManager.m */,
64F89674255FABB800AF9AD7 /* AddGDTADManager.h */, 64F89674255FABB800AF9AD7 /* AddGDTADManager.h */,
64F89678255FABB800AF9AD7 /* AddGDTADManager.m */, 64F89678255FABB800AF9AD7 /* AddGDTADManager.m */,
64F89672255FABB800AF9AD7 /* AddRuiShiADManager.h */, 64F89672255FABB800AF9AD7 /* AddRuiShiADManager.h */,
64F89673255FABB800AF9AD7 /* AddSigmobADManager.m */,
64F89671255FABB800AF9AD7 /* AddCSJADManager.h */,
64F89675255FABB800AF9AD7 /* AddCSJADManager.m */,
64F89676255FABB800AF9AD7 /* AddRuiShiADManager.m */, 64F89676255FABB800AF9AD7 /* AddRuiShiADManager.m */,
64F89677255FABB800AF9AD7 /* AddSigmobADManager.h */, 64F89677255FABB800AF9AD7 /* AddSigmobADManager.h */,
64F89673255FABB800AF9AD7 /* AddSigmobADManager.m */,
); );
path = platform; path = platform;
sourceTree = "<group>"; sourceTree = "<group>";
......
...@@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic ,retain)NSString * advertisingSpace; // 当前广告位 出入后会在广告展示 结束后上报 @property (nonatomic ,retain)NSString * advertisingSpace; // 当前广告位 出入后会在广告展示 结束后上报
@property (nonatomic ,retain) GYAdsTrackModel * currentData; // 当前广告对象
/// 单利 /// 单利
+ (IOSADManager *)shareADManager; + (IOSADManager *)shareADManager;
......
...@@ -38,7 +38,9 @@ static IOSADManager * manager = nil; ...@@ -38,7 +38,9 @@ static IOSADManager * manager = nil;
} }
return manager; return manager;
} }
- (void)dealloc{
NSLog(@">>>>>>>%@ -- dealloc",self);
}
// 视频数据 // 视频数据
...@@ -258,6 +260,7 @@ static IOSADManager * manager = nil; ...@@ -258,6 +260,7 @@ static IOSADManager * manager = nil;
AddCSJADManager * csjAd = [[AddCSJADManager alloc]init]; AddCSJADManager * csjAd = [[AddCSJADManager alloc]init];
weakSelf.csjAd = csjAd; weakSelf.csjAd = csjAd;
[weakSelf.loadADDataArray addObject:csjAd]; [weakSelf.loadADDataArray addObject:csjAd];
NSLog(@">>>>>>>%@ alloc codeid = %@",csjAd,loadADModel.codeId);
csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) { csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) {
[weakSelf blockResultLoadWithData:model andSuccess:success]; [weakSelf blockResultLoadWithData:model andSuccess:success];
...@@ -279,6 +282,7 @@ static IOSADManager * manager = nil; ...@@ -279,6 +282,7 @@ static IOSADManager * manager = nil;
AddGDTADManager * csjAd = [[AddGDTADManager alloc]init]; AddGDTADManager * csjAd = [[AddGDTADManager alloc]init];
self.gdtAd = csjAd; self.gdtAd = csjAd;
[self.loadADDataArray addObject:csjAd]; [self.loadADDataArray addObject:csjAd];
NSLog(@">>>>>>>%@ alloc codeid = %@",csjAd,loadADModel.codeId);
csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) { csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) {
...@@ -300,6 +304,7 @@ static IOSADManager * manager = nil; ...@@ -300,6 +304,7 @@ static IOSADManager * manager = nil;
AddSigmobADManager * csjAd = [[AddSigmobADManager alloc]init]; AddSigmobADManager * csjAd = [[AddSigmobADManager alloc]init];
self.sigmobAd = csjAd; self.sigmobAd = csjAd;
[self.loadADDataArray addObject:csjAd]; [self.loadADDataArray addObject:csjAd];
NSLog(@">>>>>>>%@ alloc codeid = %@",csjAd,loadADModel.codeId);
csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) { csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) {
...@@ -322,6 +327,7 @@ static IOSADManager * manager = nil; ...@@ -322,6 +327,7 @@ static IOSADManager * manager = nil;
AddRuiShiADManager * csjAd = [[AddRuiShiADManager alloc]init]; AddRuiShiADManager * csjAd = [[AddRuiShiADManager alloc]init];
self.ruishiAd = csjAd; self.ruishiAd = csjAd;
[self.loadADDataArray addObject:csjAd]; [self.loadADDataArray addObject:csjAd];
NSLog(@">>>>>>>%@ alloc codeid = %@",csjAd,loadADModel.codeId);
csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) { csjAd.loadSuccessCallbackBlock = ^(GYAdsTrackModel * _Nonnull model, BOOL success) {
...@@ -703,9 +709,19 @@ static IOSADManager * manager = nil; ...@@ -703,9 +709,19 @@ static IOSADManager * manager = nil;
}else{ }else{
[self trackingADWith:model.pullfail_tracking.firstObject]; [self trackingADWith:model.pullfail_tracking.firstObject];
NSLog(@">>>>>>> 缓存 失败 平台 = %@ ID = %@ type= %@ <<<<<<<<<",model.adPlatform,model.codeId,model.slotName); NSLog(@">>>>>>> 缓存 失败 平台 = %@ ID = %@ type= %@ <<<<<<<<<",model.adPlatform,model.codeId,model.slotName);
[self.loadADDataArray removeObject:self.loadADDataArray.firstObject];
for (int i = 0 ; i< self.loadADDataArray.count; i ++) {
IOSADManager * adManager = [self.loadADDataArray objectAtIndex:i];
if ([adManager.currentData isEqual:model] ) {
[self.loadADDataArray removeObject:adManager];
continue;;
} }
}
}
} }
...@@ -721,6 +737,8 @@ static IOSADManager * manager = nil; ...@@ -721,6 +737,8 @@ static IOSADManager * manager = nil;
}else{ }else{
NSLog(@">>>>>>> 展示 失败 平台 = %@ ID = %@ %@ type = %@ <<<<<<<<<",model.adPlatform,model.codeId,model.ADError,model.slotName); NSLog(@">>>>>>> 展示 失败 平台 = %@ ID = %@ %@ type = %@ <<<<<<<<<",model.adPlatform,model.codeId,model.ADError,model.slotName);
[self trackingADWith:model.showfail_tracking.firstObject]; [self trackingADWith:model.showfail_tracking.firstObject];
MBProgressHUD * hud = [MBProgressHUD showMessage:@"请稍等..."];
hud.minShowTime = 3;
} }
...@@ -784,7 +802,14 @@ static IOSADManager * manager = nil; ...@@ -784,7 +802,14 @@ static IOSADManager * manager = nil;
} }
[self.loadADDataArray removeObject:self.loadADDataArray.firstObject]; for (int i = 0 ; i< self.loadADDataArray.count; i ++) {
IOSADManager * adManager = [self.loadADDataArray objectAtIndex:i];
if ([adManager.currentData isEqual:model] ) {
[self.loadADDataArray removeObject:adManager];
continue;;
}
}
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@interface AddCSJADManager () @interface AddCSJADManager ()
@property (nonatomic ,retain) GYAdsTrackModel * currentData; //@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击 @property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
@implementation AddCSJADManager @implementation AddCSJADManager
- (void)loadAdWithData:(GYAdsTrackModel *)loadADModel withADType:(eADType)AdType{ - (void)loadAdWithData:(GYAdsTrackModel *)loadADModel withADType:(eADType)AdType{
self.currentData = loadADModel; self.currentData = loadADModel;
...@@ -43,11 +46,11 @@ ...@@ -43,11 +46,11 @@
}else if (AdType == ADType_Video){ //视频 }else if (AdType == ADType_Video){ //视频
GYAdsTrackModel * oldData = [IOSADManager shareADManager].cachevideo.firstObject; // GYAdsTrackModel * oldData = [IOSADManager shareADManager].cachevideo.firstObject;
if ([oldData.adPlatform isEqualToString: @"chuanshanjia"]) { // if ([oldData.adPlatform isEqualToString: @"chuanshanjia"]) {
self.loadSuccessCallbackBlock(self.currentData, NO); // self.loadSuccessCallbackBlock(self.currentData, NO);
return; // return;
} // }
BURewardedVideoModel * rewardedModel = [[BURewardedVideoModel alloc] init]; BURewardedVideoModel * rewardedModel = [[BURewardedVideoModel alloc] init];
rewardedModel.userId = USERID; rewardedModel.userId = USERID;
...@@ -83,13 +86,13 @@ ...@@ -83,13 +86,13 @@
}else if (adType == ADType_Video){ //视频 }else if (adType == ADType_Video){ //视频
if (weakSelf.rewardedAd.isAdValid) { if (weakSelf.rewardedAd.isAdValid) {
if ([weakSelf.rewardedAd showAdFromRootViewController: [(AppDelegate *)[UIApplication sharedApplication].delegate getTopViewController]]) { if ([weakSelf.rewardedAd showAdFromRootViewController: self.currentVC]) {
}else{ }else{
weakSelf.showSuccessCallbackBlock(showData, NO); weakSelf.showSuccessCallbackBlock(showData, NO);
} }
}else{ }else{
if ([weakSelf.rewardedAd showAdFromRootViewController: [(AppDelegate *)[UIApplication sharedApplication].delegate getTopViewController]]) { if ([weakSelf.rewardedAd showAdFromRootViewController: self.currentVC]) {
}else{ }else{
weakSelf.showSuccessCallbackBlock(showData, NO); weakSelf.showSuccessCallbackBlock(showData, NO);
...@@ -139,7 +142,6 @@ ...@@ -139,7 +142,6 @@
*/ */
- (void)splashAdWillVisible:(BUSplashAdView *)splashAd;{ - (void)splashAdWillVisible:(BUSplashAdView *)splashAd;{
self.showSuccessCallbackBlock(self.currentData, YES);
// [[CGUserManager shared] addLocCollection:@"splash_display" value:@"splash_display_success"]; // [[CGUserManager shared] addLocCollection:@"splash_display" value:@"splash_display_success"];
// NSString * clkTracking = self.currentData.imp_tracking[0]; // NSString * clkTracking = self.currentData.imp_tracking[0];
...@@ -187,6 +189,8 @@ ...@@ -187,6 +189,8 @@
- (void)splashAdWillClose:(BUSplashAdView *)splashAd;{ - (void)splashAdWillClose:(BUSplashAdView *)splashAd;{
self.splashAd_CSJ.hidden = YES; self.splashAd_CSJ.hidden = YES;
[self.splashAd_CSJ removeFromSuperview]; [self.splashAd_CSJ removeFromSuperview];
self.showSuccessCallbackBlock(self.currentData, YES);
} }
/** /**
...@@ -379,16 +383,22 @@ ...@@ -379,16 +383,22 @@
* This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated * This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated
*/ */
- (void)nativeExpressAdViewRenderSuccess:(BUNativeExpressAdView *)nativeExpressAdView;{ - (void)nativeExpressAdViewRenderSuccess:(BUNativeExpressAdView *)nativeExpressAdView;{
if (self.currentData.loadADType != ADType_BigImage) {
self.showSuccessCallbackBlock(self.currentData, YES); self.showSuccessCallbackBlock(self.currentData, YES);
}
} }
/** /**
* This method is called when a nativeExpressAdView failed to render * This method is called when a nativeExpressAdView failed to render
*/ */
- (void)nativeExpressAdViewRenderFail:(BUNativeExpressAdView *)nativeExpressAdView error:(NSError *_Nullable)error;{ - (void)nativeExpressAdViewRenderFail:(BUNativeExpressAdView *)nativeExpressAdView error:(NSError *_Nullable)error;{
if (self.currentData.loadADType != ADType_BigImage) {
self.showSuccessCallbackBlock(self.currentData, NO); self.showSuccessCallbackBlock(self.currentData, NO);
self.currentData.ADError = error; self.currentData.ADError = error;
}
} }
/** /**
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@interface AddGDTADManager () @interface AddGDTADManager ()
@property (nonatomic ,retain) GYAdsTrackModel * currentData; //@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击 @property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
}else if (adType == ADType_Video){ //视频 }else if (adType == ADType_Video){ //视频
// if (weakSelf.rewardVideoAd.isAdValid && [weakSelf.rewardVideoAd eCPM] > 0) { // if (weakSelf.rewardVideoAd.isAdValid && [weakSelf.rewardVideoAd eCPM] > 0) {
if (weakSelf.rewardVideoAd.isAdValid) { if (weakSelf.rewardVideoAd.isAdValid) {
if ([weakSelf.rewardVideoAd showAdFromRootViewController: [(AppDelegate *)[UIApplication sharedApplication].delegate getTopViewController]]) { if ([weakSelf.rewardVideoAd showAdFromRootViewController:self.currentVC]) {
}else{ }else{
weakSelf.showSuccessCallbackBlock(showData, NO); weakSelf.showSuccessCallbackBlock(showData, NO);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "AddRuiShiADManager.h" #import "AddRuiShiADManager.h"
@interface AddRuiShiADManager () @interface AddRuiShiADManager ()
@property (nonatomic ,retain) GYAdsTrackModel * currentData; //@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击 @property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
@interface AddSigmobADManager () @interface AddSigmobADManager ()
@property (nonatomic ,retain) GYAdsTrackModel * currentData; //@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击 @property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击
......
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