Commit 10d3f1dc authored by 李震's avatar 李震

Merge branch 'lz/gmPhobos' into 'master'

修改埋点库添加extra_param

See merge request !16
parents 3b0150ec 1b8a754c
......@@ -35,7 +35,7 @@ PODS:
- GMKit/Protocol (0.8.4):
- Masonry (= 1.1.0)
- SDWebImage (= 3.7.6)
- GMPhobos (0.5.6):
- GMPhobos (0.5.7):
- GMCache (= 0.2.3)
- GMKit
- Masonry (1.1.0)
......@@ -63,7 +63,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
GMCache: 09a3029c96fe130e3a21faef70b3d9d2ce92d639
GMKit: a30da06b84e5c4a357d427c70d1b5ec672a1f6a1
GMPhobos: cbb6997625f8eb6f0fcf7146c754f2a5564db070
GMPhobos: 1203fee705f0c103c7e730642462a96a22d9d48a
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
......
......@@ -320,6 +320,8 @@ static NSString *sdkVersion = @"110";
[dict setObject:page.referer?:@"" forKey:@"referrer"];
[dict setObject:@(0) forKey:@"fake"];
[dict setObject:page.referrerId ? : @"" forKey:@"referrer_id"];
[dict setObject:page.extraParam ? : @"" forKey:@"extra_param"];
NSAssert(page.inTime.length > 0, @"页面显示时间不应该为空!");
[Phobos track:@"page_view" attributes:dict];
}
@catch (NSException *exception) {
......
......@@ -53,4 +53,9 @@
*/
@property(nonatomic, assign) BOOL needLogPV;
/**
需要额外添加参数
*/
@property (nonatomic, copy, nonnull) NSString *extraParam;
@end
......@@ -124,4 +124,14 @@
- (void)setNeedLogPV:(BOOL)needLogPV {
objc_setAssociatedObject(self, @selector(needLogPV), @(needLogPV), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (void)setExtraParam:(NSString *)extraParam {
objc_setAssociatedObject(self, @selector(extraParam), extraParam, OBJC_ASSOCIATION_COPY);
}
- (NSString *)extraParam {
NSString *extraParam = objc_getAssociatedObject(self, @selector(extraParam));
return extraParam == nil ? @"" : extraParam;
}
@end
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