Authored by 朱小军

添加AD事件tec和cts字段上报,由tec字段是否有预值来判断 review by 金林

@@ -192,14 +192,34 @@ static NSString *kParamKeyType = @"type"; @@ -192,14 +192,34 @@ static NSString *kParamKeyType = @"type";
192 [eventDic setObject:data forKey:YOHOAppReportKeyPARAM]; 192 [eventDic setObject:data forKey:YOHOAppReportKeyPARAM];
193 } 193 }
194 194
195 - if (type == YHPT_NETWORK) {  
196 - [self.eventDataSession getbaiduNetStatus:eventDic completionBlock:^(NSTimeInterval cts, NSInteger errCode) {  
197 - [eventDic setValue:[NSString stringWithFormat:@"%ld",(long)errCode] forKey:YOHOAppReportKeyJsonKeyErrorTEC];  
198 - [eventDic setValue:@(cts) forKey:YOHOAppReportKeyJsonKeyErrorCTS];  
199 - [self pushData:eventDic dataType:YHEventReportDataTypeCustom];  
200 - }];  
201 - } else {  
202 - [self pushData:eventDic dataType:YHEventReportDataTypeCustom]; 195 + switch (type) {
  196 + case YHPT_NETWORK:
  197 + {
  198 + [self.eventDataSession getbaiduNetStatus:eventDic completionBlock:^(NSTimeInterval cts, NSInteger errCode) {
  199 + [eventDic setValue:[NSString stringWithFormat:@"%zd",errCode] forKey:YOHOAppReportKeyJsonKeyErrorTEC];
  200 + [eventDic setValue:[NSString stringWithFormat:@"%ld",(long)cts] forKey:YOHOAppReportKeyJsonKeyErrorCTS];
  201 + [self pushData:eventDic dataType:YHEventReportDataTypeCustom];
  202 + }];
  203 + }
  204 + break;
  205 + case YHPT_AD:
  206 + {
  207 + if ([data valueForKey:YOHOAppReportKeyJsonKeyErrorTEC]) {
  208 + [self.eventDataSession getbaiduNetStatus:eventDic completionBlock:^(NSTimeInterval cts, NSInteger errCode) {
  209 + [eventDic setValue:[NSString stringWithFormat:@"%zd",errCode] forKey:YOHOAppReportKeyJsonKeyErrorTEC];
  210 + [eventDic setValue:[NSString stringWithFormat:@"%ld",(long)cts] forKey:YOHOAppReportKeyJsonKeyErrorCTS];
  211 + [self pushData:eventDic dataType:YHEventReportDataTypeCustom];
  212 + }];
  213 + } else {
  214 + [self pushData:eventDic dataType:YHEventReportDataTypeCustom];
  215 + }
  216 + }
  217 + break;
  218 + default:
  219 + {
  220 + [self pushData:eventDic dataType:YHEventReportDataTypeCustom];
  221 + }
  222 + break;
203 } 223 }
204 } 224 }
205 225