Authored by 朱小军

Merge branch 'dev_ExceptionModify' into 'master'

修改exception上报条件

review by 枪兵

See merge request !34
... ... @@ -9,7 +9,7 @@
Pod::Spec.new do |s|
s.name = "YHEventReport"
s.version = "1.2.9"
s.version = "1.3.0"
s.summary = "YHEventReport."
s.description = "无埋点SDK"
s.homepage = "http://git.yoho.cn/mobile/YH_EventReport"
... ...
... ... @@ -265,28 +265,30 @@ static NSArray *kYHEventReportIgnoredViewControllerArray;
}
}
- (void)reportWithPointType:(YHPointType)type pointName:(YHEventReportPointName)name parameters:(NSDictionary *)param{
- (void)reportWithPointType:(YHPointType)type pointName:(YHEventReportPointName)name parameters:(NSDictionary *)param
{
//如果是exception类型,先保存,待下次启动后,上传;其他事件,则直接上传.
if (!self.isAppReportEnable) {
return;
}
if (type == YHPT_EXCEPTION) {
if (!self.isAppCrashReportEnable) {
return;
}
NSMutableDictionary *postMDict = [NSMutableDictionary dictionary];
[postMDict setObject:[YH_EventDataFactory getPointType:type] forKey:YOHOAppReportKeyPT];
[postMDict setObject:[YH_EventDataFactory getPointName:name] forKey:YOHOAppReportKeyPN];
[postMDict setObject:param forKey:YOHOAppReportKeyPARAM];
if (![self.crashDataMgr saveData:postMDict]) {
YHLog(@"save error data to file failed.");
if (type == YHPT_EXCEPTION
&& (name == YHPN_CRASH
|| name == YHPN_RN_EXCEPTION)) {
//只有 crash 或者 RNCrash 才会先做保存操作, 下次启动再上报
if (!self.isAppCrashReportEnable) {
return;
}
NSMutableDictionary *postMDict = [NSMutableDictionary dictionary];
[postMDict setObject:[YH_EventDataFactory getPointType:type] forKey:YOHOAppReportKeyPT];
[postMDict setObject:[YH_EventDataFactory getPointName:name] forKey:YOHOAppReportKeyPN];
[postMDict setObject:param forKey:YOHOAppReportKeyPARAM];
if (![self.crashDataMgr saveData:postMDict]) {
YHLog(@"save error data to file failed.");
}
} else {
[[YH_EventCacheManager sharedInstance] pushCustomData:IsNilOrNull(param)?@{}:param pointType:type pointName:name];
}
}else{
[[YH_EventCacheManager sharedInstance] pushCustomData:IsNilOrNull(param)?@{}:param pointType:type pointName:name];
}
}
#pragma mark - Exception handle methods
... ...