From 2155f5f93b8dc5744f069da53aa0492f2f4fa49b Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Thu, 1 May 2014 16:57:28 +0200 Subject: [PATCH] Add app build property to BITCrashDetails --- Classes/BITCrashDetails.h | 29 ++++++++++++++++++++++++++++- Classes/BITCrashDetails.m | 4 +++- Classes/BITCrashManager.m | 2 ++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Classes/BITCrashDetails.h b/Classes/BITCrashDetails.h index 1c5988f71b..b9322f35f3 100644 --- a/Classes/BITCrashDetails.h +++ b/Classes/BITCrashDetails.h @@ -10,26 +10,53 @@ @interface BITCrashDetails : NSObject +/** + * UUID for the crash report + */ @property (nonatomic, readonly, strong) NSString *incidentIdentifier; +/** + * UUID for the app installation on the device + */ @property (nonatomic, readonly, strong) NSString *reporterKey; +/** + * Signal that caused the crash + */ @property (nonatomic, readonly, strong) NSString *signal; +/** + * Exception name that triggered the crash, nil if the crash was not caused by an exception + */ @property (nonatomic, readonly, strong) NSString *exceptionName; +/** + * Exception reason, nil if the crash was not caused by an exception + */ @property (nonatomic, readonly, strong) NSString *exceptionReason; +/** + * Date and time the app started, nil if unknown + */ @property (nonatomic, readonly, strong) NSDate *appStartTime; +/** + * Date and time the crash occured, nil if unknown + */ @property (nonatomic, readonly, strong) NSDate *crashTime; +/** + * CFBundleVersion value of the app that crashed + */ +@property (nonatomic, readonly, strong) NSString *appBuild; + - (instancetype)initWithIncidentIdentifier:(NSString *)incidentIdentifier reporterKey:(NSString *)reporterKey signal:(NSString *)signal exceptionName:(NSString *)exceptionName exceptionReason:(NSString *)exceptionReason appStartTime:(NSDate *)appStartTime - crashTime:(NSDate *)crashTime; + crashTime:(NSDate *)crashTime + appBuild:(NSString *)appBuild; @end diff --git a/Classes/BITCrashDetails.m b/Classes/BITCrashDetails.m index d201fac9c1..187b7ba0bc 100644 --- a/Classes/BITCrashDetails.m +++ b/Classes/BITCrashDetails.m @@ -16,7 +16,8 @@ exceptionName:(NSString *)exceptionName exceptionReason:(NSString *)exceptionReason appStartTime:(NSDate *)appStartTime - crashTime:(NSDate *)crashTime; + crashTime:(NSDate *)crashTime + appBuild:(NSString *)appBuild { if ((self = [super init])) { _incidentIdentifier = incidentIdentifier; @@ -26,6 +27,7 @@ _exceptionReason = exceptionReason; _appStartTime = appStartTime; _crashTime = crashTime; + _appBuild = appBuild; } return self; } diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index cca18876da..226ae9bf3c 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -788,6 +788,7 @@ static PLCrashReporterCallbacks plCrashCallbacks = { exceptionReason:report.exceptionInfo.exceptionReason appStartTime:appStartTime crashTime:appCrashTime + appBuild:report.applicationInfo.applicationVersion ]; } } @@ -1135,6 +1136,7 @@ static PLCrashReporterCallbacks plCrashCallbacks = { exceptionReason:nil appStartTime:nil crashTime:nil + appBuild:fakeReportAppVersion ]; NSData *plist = [NSPropertyListSerialization dataFromPropertyList:(id)rootObj