Commit 93c765ca authored by zhangshuai's avatar zhangshuai

优化 广告bug

parent f19e326b
...@@ -357,6 +357,7 @@ static CGNetworkTools* _tools = nil; ...@@ -357,6 +357,7 @@ static CGNetworkTools* _tools = nil;
if ([[data Read] objectForKey:@"source"]) { if ([[data Read] objectForKey:@"source"]) {
[dict setValue: [[data Read] objectForKey:@"source"] forKey: @"source"]; [dict setValue: [[data Read] objectForKey:@"source"] forKey: @"source"];
} }
[dict setValue: @"toutiao" forKey: @"source"];
NSString *uid = [[data Read] objectForKey:@"uid"]; NSString *uid = [[data Read] objectForKey:@"uid"];
if (uid != nil) { [dict setValue: uid forKey: @"uid"]; } if (uid != nil) { [dict setValue: uid forKey: @"uid"]; }
......
This diff is collapsed.
...@@ -72,17 +72,21 @@ ...@@ -72,17 +72,21 @@
/// @param adType 广告类型 /// @param adType 广告类型
- (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{ - (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{
if (adType == ADType_OpenScreen) { // 开屏 dispatch_async(dispatch_get_main_queue(), ^{
if (adType == ADType_OpenScreen) { // 开屏
}else if (adType == ADType_Video){ //视频
if (self.rewardedAd.isAdValid) { }else if (adType == ADType_Video){ //视频
[self.rewardedAd showAdFromRootViewController:self.currentVC]; if (self.rewardedAd.isAdValid) {
}else{ [self.rewardedAd showAdFromRootViewController:self.currentVC];
self.showSuccessCallbackBlock(showData, NO); }else{
self.showSuccessCallbackBlock(showData, NO);
}
}else if (adType == ADType_BigImage){ //大图
} }
}else if (adType == ADType_BigImage){ //大图 });
}
} }
......
...@@ -66,18 +66,20 @@ ...@@ -66,18 +66,20 @@
/// @param showData 广告对象 /// @param showData 广告对象
/// @param adType 广告类型 /// @param adType 广告类型
- (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{ - (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{
dispatch_async(dispatch_get_main_queue(), ^{
if (adType == ADType_OpenScreen) { // 开屏 if (adType == ADType_OpenScreen) { // 开屏
}else if (adType == ADType_Video){ //视频 }else if (adType == ADType_Video){ //视频
if (self.rewardVideoAd.isAdValid) { if (self.rewardVideoAd.isAdValid) {
[self.rewardVideoAd showAdFromRootViewController:self.currentVC]; [self.rewardVideoAd showAdFromRootViewController:self.currentVC];
}else{ }else{
self.showSuccessCallbackBlock(showData, NO); self.showSuccessCallbackBlock(showData, NO);
}
}else if (adType == ADType_BigImage){ //大图
} }
}else if (adType == ADType_BigImage){ //大图 });
}
} }
//MARK:开屏 //MARK:开屏
......
...@@ -62,15 +62,19 @@ ...@@ -62,15 +62,19 @@
/// @param adType 广告类型 /// @param adType 广告类型
- (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{ - (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{
if (adType == ADType_OpenScreen) { // 开屏 dispatch_async(dispatch_get_main_queue(), ^{
if (adType == ADType_OpenScreen) { // 开屏
}else if (adType == ADType_Video){ //视频
}else if (adType == ADType_Video){ //视频
[self.vlnVideoAD showAdFromRootViewController:self.currentVC];
[self.vlnVideoAD showAdFromRootViewController:self.currentVC];
}else if (adType == ADType_BigImage){ //大图
}else if (adType == ADType_BigImage){ //大图
}
}
});
} }
......
...@@ -57,20 +57,22 @@ ...@@ -57,20 +57,22 @@
/// @param showData 广告对象 /// @param showData 广告对象
/// @param adType 广告类型 /// @param adType 广告类型
- (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{ - (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;{
NSString * ADID = showData.codeId;
dispatch_async(dispatch_get_main_queue(), ^{
NSString * ADID = showData.codeId;
if (adType == ADType_OpenScreen) { // 开屏 if (adType == ADType_OpenScreen) { // 开屏
}else if (adType == ADType_Video){ //视频 }else if (adType == ADType_Video){ //视频
if ([[WindRewardedVideoAd sharedInstance] isReady:ADID]) { if ([[WindRewardedVideoAd sharedInstance] isReady:ADID]) {
[[WindRewardedVideoAd sharedInstance] playAd:self.currentVC withPlacementId:ADID options:@{} error:nil]; [[WindRewardedVideoAd sharedInstance] playAd:self.currentVC withPlacementId:ADID options:@{} error:nil];
}else{ }else{
self.showSuccessCallbackBlock(showData, NO); self.showSuccessCallbackBlock(showData, NO);
}
}else if (adType == ADType_BigImage){ //大图
} }
}else if (adType == ADType_BigImage){ //大图 });
}
} }
//MARK: ---- 开屏 ---- //MARK: ---- 开屏 ----
......
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