Authored by 朱小军

更新支持subcid参数上报 review by 孟顺

1 Pod::Spec.new do |s| 1 Pod::Spec.new do |s|
2 s.name = "YH_Analytics" 2 s.name = "YH_Analytics"
3 - s.version = "3.1.9" 3 + s.version = "3.2.0"
4 s.summary = "Analytics Kit" 4 s.summary = "Analytics Kit"
5 s.description = <<-DESC 5 s.description = <<-DESC
6 Analytics Kit 6 Analytics Kit
@@ -119,7 +119,8 @@ @@ -119,7 +119,8 @@
119 #define JsonKeyEventOP @"op" // 操作id 119 #define JsonKeyEventOP @"op" // 操作id
120 #define JsonKeyEventPARAM @"param" // 操作参数 120 #define JsonKeyEventPARAM @"param" // 操作参数
121 #define JsonKeyEventINDEX @"indx" // 事件序号 121 #define JsonKeyEventINDEX @"indx" // 事件序号
122 -#define JsonKeyEventCID @"C_ID" // 频道ID 122 +#define JsonKeyEventCID @"C_ID" // 男女频道ID
  123 +#define JsonKeyEventSUBCID @"SUB_C_ID" // 当前频道ID
123 #define JsonKeyEventAB_TYPE @"AB_TYPE" // ABTest测试类别 124 #define JsonKeyEventAB_TYPE @"AB_TYPE" // ABTest测试类别
124 125
125 // 错误参数 126 // 错误参数
@@ -148,11 +148,18 @@ typedef NS_ENUM(NSInteger, YHLogStrategy) { @@ -148,11 +148,18 @@ typedef NS_ENUM(NSInteger, YHLogStrategy) {
148 @property (nonatomic) BOOL enableDebugOn; 148 @property (nonatomic) BOOL enableDebugOn;
149 149
150 /** 150 /**
151 - @brief 频道id 151 + @brief 男女频道id(切换其他频道仍是切换前的)
152 152
153 @since 1.0.1 153 @since 1.0.1
154 */ 154 */
155 @property (copy, nonatomic) NSString *cid; 155 @property (copy, nonatomic) NSString *cid;
  156 +
  157 +/**
  158 + @brief 频道id(当前切换的频道)
  159 +
  160 + @since 1.0.1
  161 + */
  162 +@property (copy, nonatomic) NSString *subcid;
156 /** 163 /**
157 @brief ABTest测试类别 164 @brief ABTest测试类别
158 165
@@ -280,8 +280,9 @@ @@ -280,8 +280,9 @@
280 event.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex]; 280 event.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex];
281 281
282 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param]; 282 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param];
283 - [params setObject:self.cid?:@"" forKey:JsonKeyEventCID];  
284 - [params setObject:self.ABType?:@"" forKey:JsonKeyEventAB_TYPE]; 283 + [params setValue:self.cid forKey:JsonKeyEventCID];
  284 + [params setValue:self.subcid forKey:JsonKeyEventSUBCID];
  285 + [params setValue:self.ABType forKey:JsonKeyEventAB_TYPE];
285 286
286 event.param = params; 287 event.param = params;
287 288
@@ -325,7 +326,8 @@ @@ -325,7 +326,8 @@
325 } 326 }
326 327
327 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param]; 328 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param];
328 - [params setObject:self.cid?:@"" forKey:JsonKeyEventCID]; 329 + [params setValue:self.cid forKey:JsonKeyEventCID];
  330 + [params setValue:self.subcid forKey:JsonKeyEventSUBCID];
329 error.param = params; 331 error.param = params;
330 // crash 和 rnException 不支持立即发送 332 // crash 和 rnException 不支持立即发送
331 if ((self.logStrategy & LogStrategyImmedi) != 0 && 333 if ((self.logStrategy & LogStrategyImmedi) != 0 &&
@@ -350,7 +352,8 @@ @@ -350,7 +352,8 @@
350 perfermance.sid = self.session; 352 perfermance.sid = self.session;
351 353
352 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param]; 354 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param];
353 - [params setObject:self.cid?:@"" forKey:JsonKeyEventCID]; 355 + [params setValue:self.cid forKey:JsonKeyEventCID];
  356 + [params setValue:self.subcid forKey:JsonKeyEventSUBCID];
354 perfermance.param = params; 357 perfermance.param = params;
355 // 立即发送策略 358 // 立即发送策略
356 // if ((self.logStrategy & LogStrategyImmedi) != 0) { 359 // if ((self.logStrategy & LogStrategyImmedi) != 0) {
@@ -378,7 +381,8 @@ @@ -378,7 +381,8 @@
378 patch.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex]; 381 patch.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex];
379 382
380 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param]; 383 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:param];
381 - [params setObject:self.cid?:@"" forKey:JsonKeyEventCID]; 384 + [params setValue:self.cid forKey:JsonKeyEventCID];
  385 + [params setValue:self.subcid forKey:JsonKeyEventSUBCID];
382 patch.param = params; 386 patch.param = params;
383 387
384 // 立即发送策略 388 // 立即发送策略