Commit 60fcc8e8 authored by zhangshuai's avatar zhangshuai

处理bug

parent 6b2f4d0c
......@@ -81,7 +81,7 @@
#import "MBProgressHUD+MJ.h"
#import "Masonry.h"
#import "GYBaseModel.h"
#import <MJExtension/MJExtension.h>
#import <UMCommon/MobClick.h>
#import "IOSADManager.h" //AD
......
......@@ -13,7 +13,7 @@
@interface AddCSJADManager ()
@property (nonatomic ,retain) GYAdsTrackModel * csjLoadData;
@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property (nonatomic, copy) NSString * clk_tracking; //防止多次上报点击
......@@ -24,7 +24,7 @@
- (void)loadAdWithData:(GYAdsTrackModel *)loadADModel withADType:(eADType)AdType{
self.csjLoadData = loadADModel;
self.currentData = loadADModel;
WEAKSELF;
GYAdsTrackModel * model = loadADModel;
if (AdType == ADType_OpenScreen) { // 开屏
......@@ -92,7 +92,9 @@
This method is called when splash ad material loaded successfully.
*/
- (void)splashAdDidLoad:(BUSplashAdView *)splashAd;{
self.loadSuccessCallbackBlock(self.csjLoadData, YES);
self.loadSuccessCallbackBlock(self.currentData, YES);
WEAKSELF;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIWindow *keyWindow = [UIApplication sharedApplication].windows.lastObject;
......@@ -107,7 +109,7 @@
@param error : the reason of error
*/
- (void)splashAd:(BUSplashAdView *)splashAd didFailWithError:(NSError * _Nullable)error;{
self.loadSuccessCallbackBlock(self.csjLoadData, NO);
self.loadSuccessCallbackBlock(self.currentData, NO);
}
......@@ -116,10 +118,10 @@
*/
- (void)splashAdWillVisible:(BUSplashAdView *)splashAd;{
self.showSuccessCallbackBlock(self.csjLoadData, YES);
self.showSuccessCallbackBlock(self.currentData, YES);
// [[CGUserManager shared] addLocCollection:@"splash_display" value:@"splash_display_success"];
// NSString * clkTracking = self.csjLoadData.imp_tracking[0];
// NSString * clkTracking = self.currentData.imp_tracking[0];
// if (clkTracking.length > 0) {
// [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
//
......@@ -134,7 +136,9 @@
*/
- (void)splashAdDidClick:(BUSplashAdView *)splashAd;{
// NSString * clkTracking = self.csjLoadData.clk_tracking[0];
[self trackingADWith:self.currentData.clk_tracking.firstObject];
// NSString * clkTracking = self.currentData.clk_tracking[0];
// if ([self.clk_tracking isEqualToString:clkTracking]) {
// return;
......@@ -194,7 +198,7 @@
*/
- (void)nativeExpressRewardedVideoAdDidLoad:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;{
self.loadSuccessCallbackBlock(self.csjLoadData,YES);
self.loadSuccessCallbackBlock(self.currentData,YES);
}
......@@ -203,7 +207,7 @@
@param error : the reason of error
*/
- (void)nativeExpressRewardedVideoAd:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;{
self.loadSuccessCallbackBlock(self.csjLoadData,NO);
self.loadSuccessCallbackBlock(self.currentData,NO);
self.splashAd_CSJ.hidden = YES;
[self.splashAd_CSJ removeFromSuperview];
......@@ -265,14 +269,14 @@
This method is called when video ad is closed.
*/
- (void)nativeExpressRewardedVideoAdDidClose:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;{
self.showSuccessCallbackBlock(self.csjLoadData, YES);
self.showSuccessCallbackBlock(self.currentData, YES);
}
/**
This method is called when video ad is clicked.
This method is called when video ad is clicked. 点击
*/
- (void)nativeExpressRewardedVideoAdDidClick:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
......@@ -296,7 +300,7 @@
@param verify :return YES when return value is 2000.
*/
- (void)nativeExpressRewardedVideoAdServerRewardDidSucceed:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd verify:(BOOL)verify;{
// self.showSuccessCallbackBlock(self.csjLoadData, YES);
// self.showSuccessCallbackBlock(self.currentData, YES);
}
......@@ -307,7 +311,7 @@
@param error request error info
*/
- (void)nativeExpressRewardedVideoAdServerRewardDidFail:(BUNativeExpressRewardedVideoAd *)rewardedVideoAd error:(NSError *_Nullable)error;{
self.showSuccessCallbackBlock(self.csjLoadData, NO);
self.showSuccessCallbackBlock(self.currentData, NO);
}
......@@ -324,7 +328,7 @@
* Sent when views successfully load ad
*/
- (void)nativeExpressAdSuccessToLoad:(BUNativeExpressAdManager *)nativeExpressAd views:(NSArray<__kindof BUNativeExpressAdView *> *)views;{
self.loadSuccessCallbackBlock(self.csjLoadData,YES);
self.loadSuccessCallbackBlock(self.currentData,YES);
if ([nativeExpressAd isMemberOfClass:[BUNativeExpressAdManager class]]) {
if (views.count) {
......@@ -341,7 +345,7 @@
* Sent when views fail to load ad
*/
- (void)nativeExpressAdFailToLoad:(BUNativeExpressAdManager *)nativeExpressAd error:(NSError *_Nullable)error;{
self.loadSuccessCallbackBlock(self.csjLoadData,NO);
self.loadSuccessCallbackBlock(self.currentData,NO);
}
......@@ -349,14 +353,14 @@
* This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated
*/
- (void)nativeExpressAdViewRenderSuccess:(BUNativeExpressAdView *)nativeExpressAdView;{
self.showSuccessCallbackBlock(self.csjLoadData, YES);
self.showSuccessCallbackBlock(self.currentData, YES);
}
/**
* This method is called when a nativeExpressAdView failed to render
*/
- (void)nativeExpressAdViewRenderFail:(BUNativeExpressAdView *)nativeExpressAdView error:(NSError *_Nullable)error;{
self.showSuccessCallbackBlock(self.csjLoadData, NO);
self.showSuccessCallbackBlock(self.currentData, NO);
}
/**
......@@ -370,6 +374,7 @@
* Sent when an ad view is clicked
*/
- (void)nativeExpressAdViewDidClick:(BUNativeExpressAdView *)nativeExpressAdView;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
......
......@@ -85,6 +85,7 @@
* 开屏广告成功展示
*/
- (void)splashAdSuccessPresentScreen:(GDTSplashAd *)splashAd;{
}
......@@ -127,7 +128,10 @@
/**
* 开屏广告点击回调
*/
- (void)splashAdClicked:(GDTSplashAd *)splashAd;{}
- (void)splashAdClicked:(GDTSplashAd *)splashAd;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
* 开屏广告将要关闭回调
......@@ -230,6 +234,7 @@
@param rewardedVideoAd GDTRewardVideoAd 实例
*/
- (void)gdt_rewardVideoAdDidClicked:(GDTRewardVideoAd *)rewardedVideoAd;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
......@@ -335,7 +340,10 @@
/**
* 原生模板广告点击回调
*/
- (void)nativeExpressAdViewClicked:(GDTNativeExpressAdView *)nativeExpressAdView;{}
- (void)nativeExpressAdViewClicked:(GDTNativeExpressAdView *)nativeExpressAdView;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
* 原生模板广告被关闭
......
......@@ -107,6 +107,7 @@
开屏广告点击回调
*/
- (void)vl_splashAdDidClick:(VLNSplashAd *)splashAd{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
......@@ -159,7 +160,10 @@
/**
视频广告信息点击回调
*/
- (void)vl_rewardVideoAdDidClicked:(VLNRewardedVideoAd *)rewardedVideoAd{}
- (void)vl_rewardVideoAdDidClicked:(VLNRewardedVideoAd *)rewardedVideoAd{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
视频广告加载错误信息回调
......@@ -223,7 +227,9 @@
/**
广告点击回调
*/
- (void)vl_nativeAdDidClick:(VLNNativeAd *)nativeAd;{}
- (void)vl_nativeAdDidClick:(VLNNativeAd *)nativeAd;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
广告点击关闭
......
......@@ -96,6 +96,7 @@
* 开屏广告点击回调
*/
- (void)onSplashAdClicked:(WindSplashAd *)splashAd;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
......@@ -166,6 +167,46 @@
}
/**
激励视频广告开始播放
@param placementId 广告位Id
*/
- (void)onVideoAdPlayStart:(NSString *)placementId;{
}
/**
激励视频广告发生点击
@param placementId 广告位Id
*/
- (void)onVideoAdClicked:(NSString *)placementId;{
[self trackingADWith:self.currentData.clk_tracking.firstObject];
}
/**
激励视频广告AdServer返回广告(表示渠道有广告填充)
@param placementId 广告位Id
*/
- (void)onVideoAdServerDidSuccess:(NSString *)placementId;{
}
/**
激励视频广告AdServer无广告返回(表示渠道无广告填充)
@param placementId 广告位Id
*/
- (void)onVideoAdServerDidFail:(NSString *)placementId;{
}
//MARK: ---- 大图 ---- 原生
......
......@@ -20,20 +20,28 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic ,strong) NSString *adPlatform; // guangdiantong 平台
@property (nonatomic ,assign) NSInteger adType; // 忽略 //
@property (nonatomic ,strong) NSArray *clk_tracking; // 点击广告 调用
@property (nonatomic ,strong) NSString *codeId; // codeId = 945568416; //广告位ID 请求广告
@property (nonatomic ,strong) NSArray *imp_tracking; // 展示 调用
@property (nonatomic ,assign) NSInteger platformId; // 平台 ID
@property (nonatomic ,strong) NSString * showfail_tracking; //showfail_tracking 显示 失败
@property (nonatomic ,strong) NSString * pullfail_tracking; //showfail_tracking 拉 失败
@property (nonatomic ,strong) NSString * pullsucc_tracking; //showfail_tracking 拉 成功
@property (nonatomic ,assign) NSInteger codeAppId; //广告商APP ID
@property (nonatomic ,assign) NSInteger slot_id; //
@property (nonatomic ,strong) NSString * slotName; //
// 广告事件回调
@property (nonatomic ,strong) NSArray * imp_tracking; // 展示 调用
@property (nonatomic ,strong) NSArray * showfail_tracking; //showfail_tracking 显示 失败
@property (nonatomic ,strong) NSArray * pullfail_tracking; //showfail_tracking 拉 失败
@property (nonatomic ,strong) NSArray * pullsucc_tracking; //showfail_tracking 拉 成功
@property (nonatomic ,strong) NSArray * clk_tracking; // 点击广告 调用
@property (nonatomic ,strong) NSArray * playcomplete_trackings; //播放成功
@property (nonatomic ,strong) NSMutableArray <GYAdsTrackModel *> * backups; // 用于缓存.成功几率比较高
@property (nonatomic ,assign) BOOL loadSuccess; //加载成功
//逻辑字段
@property (nonatomic ,assign) BOOL firstFailure; // 第一个失败
@property (nonatomic ,assign) eADType loadADType; //这个广告所属的广告类型
+(instancetype)modelWithDic:(NSDictionary *)dict;
......
......@@ -80,6 +80,16 @@ NS_ASSUME_NONNULL_BEGIN
- (void)showADType:(eADType )AdType resultBlock:(void(^)(BOOL success)) adShowBlock;
//MARK: 广告链接上报
/// 广告事件上报
/// @param url 要上报的地址
- (void)trackingADWith:(NSString *)url;
//------------------------------------- 以下下方法是不要主动调用可以 -----------------------------
/// 加载一条缓存
/// @param loadADModel 广告对象
/// @param AdType 广告类型
......@@ -91,7 +101,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @param adType 广告类型
- (void)showAdWithData:(GYAdsTrackModel *)showData withADType:(eADType)adType;
/// 请求开平数据
- (void)requestOpenScreenAD;
......
This diff is collapsed.
......@@ -1431,7 +1431,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 103;
CURRENT_PROJECT_VERSION = 104;
DEVELOPMENT_TEAM = "";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
......@@ -1441,7 +1441,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
......@@ -1478,14 +1478,14 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 103;
CURRENT_PROJECT_VERSION = 104;
DEVELOPMENT_TEAM = "";
GCC_ENABLE_CPP_EXCEPTIONS = NO;
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"$(inherited)",
......@@ -1640,7 +1640,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 103;
CURRENT_PROJECT_VERSION = 104;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
GCC_ENABLE_CPP_EXCEPTIONS = NO;
......@@ -1648,7 +1648,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
......@@ -1751,14 +1751,14 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 103;
CURRENT_PROJECT_VERSION = 104;
DEVELOPMENT_TEAM = "";
GCC_ENABLE_CPP_EXCEPTIONS = NO;
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_GENERATE_MAP_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
......
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