Commit ed7779db authored by zhangshuai's avatar zhangshuai

修改缓存 特殊情况的 不连贯问题

parent ba8ac267
......@@ -311,7 +311,9 @@ static IOSADManager * manager = nil;
}else{
if (AdType == ADType_Video) { // 视频
GYAdsTrackModel * adData = self.videoModels.firstObject;
GYAdsTrackModel * adData = loadADModel;
NSLog(@">>>>>>> 缓存 失败 %@ 不支持",adData.adPlatform);
if (adData.firstFailure == NO) {
adData.firstFailure = YES;
}else{
......@@ -320,7 +322,7 @@ static IOSADManager * manager = nil;
if (adData.backups.count) {
[self loadAdWithData:adData.backups.firstObject withADType:AdType];
}else{
[self.videoModels removeObject:self.videoModels.firstObject];
[self.videoModels removeObject:loadADModel];
if (self.videoModels.count) {
[self loadAdWithData:self.videoModels.firstObject withADType:AdType];
......@@ -384,10 +386,13 @@ static IOSADManager * manager = nil;
}else if ([showData.adPlatform isEqualToString:@"ruishi"]){
[self.ruishiAd showAdWithData:showData withADType:adType];
}
if (self.videoModels.count <= 1) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf requestVideoAD];
});
}else{
[self loadAdWithData:self.videoModels[1] withADType:ADType_Video];
}
}else if (adType == ADType_BigImage){ //大图
......@@ -526,15 +531,18 @@ static IOSADManager * manager = nil;
[weakSelf.videoModels addObjectsFromArray:models];
//有缓存
if (weakSelf.cachevideo.count == 0 && weakSelf.videoModels.count == 1) {
[weakSelf loadAdWithData:weakSelf.videoModels.firstObject withADType:ADType_Video];
if (weakSelf.cachevideo.count <= 1 ) {
if (weakSelf.videoModels.count > 1) {
[weakSelf loadAdWithData:weakSelf.videoModels[1] withADType:ADType_Video];
}else{
[weakSelf loadAdWithData:weakSelf.videoModels.firstObject withADType:ADType_Video];
}
}else{
if (weakSelf.videoModels.count >=2) {
[weakSelf loadAdWithData:weakSelf.videoModels[1] withADType:ADType_Video];
}else{
NSLog(@">>>>weakSelf.cachevideo == %lu",(unsigned long)weakSelf.videoModels.count);
}
}
}else{
[[CGUserManager shared] addLocCollection:@"reward_request" value:@"reward_request_failed"];
......@@ -616,11 +624,11 @@ static IOSADManager * manager = nil;
- (void)blockResultShowWithData:(GYAdsTrackModel *)model andSuccess:(BOOL)success;{
WEAKSELF;
if (success) { //埋点
NSLog(@">>>>>>> 缓存 成功 平台 = %@ ID = %@ <<<<<<<<<",model.adPlatform,model.codeId);
NSLog(@">>>>>>> 展示 成功 平台 = %@ ID = %@ <<<<<<<<<",model.adPlatform,model.codeId);
[self trackingADWith:model.imp_tracking.firstObject];
[self trackingADWith:model.playcomplete_trackings.firstObject];
}else{
NSLog(@">>>>>>> 缓存 失败 平台 = %@ ID = %@ %@ <<<<<<<<<",model.adPlatform,model.codeId,model.ADError);
NSLog(@">>>>>>> 展示 失败 平台 = %@ ID = %@ %@ <<<<<<<<<",model.adPlatform,model.codeId,model.ADError);
[self trackingADWith:model.showfail_tracking.firstObject];
}
......
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