Commit 93c765ca authored by zhangshuai's avatar zhangshuai

优化 广告bug

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