From bdbc7eb458cc601566aa6f099685f1f530747c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Thu, 30 Jun 2016 14:29:58 +0200 Subject: [PATCH 01/16] Add Bitcode marker back to simulator slices This is necessary because otherwise `lipo` apparently strips the Bitcode sections from the merged library completely. Unfortunately, this breaks compatibility with Xcode 6. --- Support/release.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/release.xcconfig b/Support/release.xcconfig index f73473130a..433b211fc3 100644 --- a/Support/release.xcconfig +++ b/Support/release.xcconfig @@ -1,4 +1,4 @@ #include "buildnumber.xcconfig" OTHER_CFLAGS[sdk=iphoneos9.*] = $(HOCKEYSDK_WARNING_FLAGS) -fembed-bitcode -OTHER_CFLAGS[sdk=iphonesimulator9.*] = $(HOCKEYSDK_WARNING_FLAGS) +OTHER_CFLAGS[sdk=iphonesimulator9.*] = $(HOCKEYSDK_WARNING_FLAGS) -fembed-bitcode-marker From b647a586d3e3aeb54fc80b2ff4b6fa2da9db6636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Thu, 7 Jul 2016 17:14:00 +0200 Subject: [PATCH 02/16] Add additional logging in crash processing flow --- Classes/BITCrashManager.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index f22162a3bc..4cae9868bd 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -737,6 +737,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf * @param filename the crash reports temp filename */ - (void)storeMetaDataForCrashReportFilename:(NSString *)filename { + BITHockeyLog(@"VERBOSE: Storing meta data for crash report with filename %@", filename); NSError *error = NULL; NSMutableDictionary *metaDict = [NSMutableDictionary dictionaryWithCapacity:4]; NSString *applicationLog = @""; @@ -751,6 +752,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [metaDict setObject:applicationLog forKey:kBITCrashMetaApplicationLog]; if ([self.delegate respondsToSelector:@selector(attachmentForCrashManager:)]) { + BITHockeyLog(@"VERBOSE: Processing attachment for crash report with filename %@", filename); BITHockeyAttachment *attachment = [self.delegate attachmentForCrashManager:self]; if (attachment && attachment.hockeyAttachmentData) { @@ -765,8 +767,9 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf if (plist) { [plist writeToFile:[_crashesDir stringByAppendingPathComponent: [filename stringByAppendingPathExtension:@"meta"]] atomically:YES]; } else { - BITHockeyLog(@"ERROR: Writing crash meta data failed. %@", error); + BITHockeyLog(@"ERROR: Serializing metaDict failed. %@", error); } + BITHockeyLog(@"VERBOSE: Storing crash meta data finished."); } - (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData { @@ -817,6 +820,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf * Parse the new crash report and gather additional meta data from the app which will be stored along the crash report */ - (void) handleCrashReport { + BITHockeyLog(@"VERBOSE: Handling crash report"); NSError *error = NULL; if (!self.plCrashReporter) return; @@ -825,6 +829,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf if (![_fileManager fileExistsAtPath:_analyzerInProgressFile]) { // mark the start of the routine [_fileManager createFileAtPath:_analyzerInProgressFile contents:nil attributes:nil]; + BITHockeyLog(@"VERBOSE: AnalyzerInProgress file created"); [self saveSettings]; @@ -880,6 +885,8 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [self storeMetaDataForCrashReportFilename:cacheFilename]; } } + } else { + BITHockeyLog(@"WARNING: AnalyzerInProgress file found, handling crash report skipped"); } // Purge the report @@ -968,6 +975,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } - (void)triggerDelayedProcessing { + BITHockeyLog(@"VERBOE: Triggering delayed crash processing."); [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invokeDelayedProcessing) object:nil]; [self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5]; } @@ -1222,6 +1230,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } if (considerReport) { + BITHockeyLog(@"INFO: App kill detected, creating crash report."); [self createCrashReportForAppKill]; _didCrashInLastSession = YES; @@ -1241,6 +1250,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [[NSUserDefaults standardUserDefaults] synchronize]; [self triggerDelayedProcessing]; + BITHockeyLog(@"VERBOSE: CrashManager startManager has finished."); } /** From fa38499602e616d3cf4c3f85f18df43fea67996f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Thu, 7 Jul 2016 17:14:41 +0200 Subject: [PATCH 03/16] Add additonal error logging in attachment processing --- Classes/BITCrashManager.m | 18 ++++++++++++++---- Classes/BITCrashManagerPrivate.h | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 4cae9868bd..b7567ab829 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -327,7 +327,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } } -- (void)persistAttachment:(BITHockeyAttachment *)attachment withFilename:(NSString *)filename { +- (BOOL)persistAttachment:(BITHockeyAttachment *)attachment withFilename:(NSString *)filename { NSString *attachmentFilename = [filename stringByAppendingString:@".data"]; NSMutableData *data = [[NSMutableData alloc] init]; NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data]; @@ -336,7 +336,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [archiver finishEncoding]; - [data writeToFile:attachmentFilename atomically:YES]; + return [data writeToFile:attachmentFilename atomically:YES]; } - (void)persistUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData { @@ -756,7 +756,14 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf BITHockeyAttachment *attachment = [self.delegate attachmentForCrashManager:self]; if (attachment && attachment.hockeyAttachmentData) { - [self persistAttachment:attachment withFilename:[_crashesDir stringByAppendingPathComponent: filename]]; + BOOL success = [self persistAttachment:attachment withFilename:[_crashesDir stringByAppendingPathComponent: filename]]; + if (!success) { + BITHockeyLog(@"ERROR: Persisting the crash attachment failed"); + } else { + BITHockeyLog(@"VERBOSE: Crash attachment successfully persisted."); + } + } else { + BITHockeyLog(@"INFO: Crash attachment was nil"); } } @@ -765,7 +772,10 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf options:0 error:&error]; if (plist) { - [plist writeToFile:[_crashesDir stringByAppendingPathComponent: [filename stringByAppendingPathExtension:@"meta"]] atomically:YES]; + BOOL success = [plist writeToFile:[_crashesDir stringByAppendingPathComponent: [filename stringByAppendingPathExtension:@"meta"]] atomically:YES]; + if (!success) { + BITHockeyLog(@"ERROR: Writing crash meta data failed."); + } } else { BITHockeyLog(@"ERROR: Serializing metaDict failed. %@", error); } diff --git a/Classes/BITCrashManagerPrivate.h b/Classes/BITCrashManagerPrivate.h index 5bb40500e2..a7f1111842 100644 --- a/Classes/BITCrashManagerPrivate.h +++ b/Classes/BITCrashManagerPrivate.h @@ -94,7 +94,7 @@ - (NSString *)firstNotApprovedCrashReport; - (void)persistUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData; -- (void)persistAttachment:(BITHockeyAttachment *)attachment withFilename:(NSString *)filename; +- (BOOL)persistAttachment:(BITHockeyAttachment *)attachment withFilename:(NSString *)filename; - (BITHockeyAttachment *)attachmentForCrashReport:(NSString *)filename; From 22c40b7e24532a0bb6c20a2c78fbef3e07e7ee64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Thu, 7 Jul 2016 17:16:04 +0200 Subject: [PATCH 04/16] Fix analyzerInProgress file always being reset at app start With this line in place, the analyzerInProgress file that is used to detect errors/crashes in previous crash processing is always reset at app start. This prevents proper error detection if crash processing crashes/didn't finish in the previous run. --- Classes/BITCrashManager.m | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index b7567ab829..3ebdfe444a 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -213,10 +213,6 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf _settingsFile = [_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_SETTINGS]; _analyzerInProgressFile = [_crashesDir stringByAppendingPathComponent:BITHOCKEY_CRASH_ANALYZER]; - if ([_fileManager fileExistsAtPath:_analyzerInProgressFile]) { - NSError *error = nil; - [_fileManager removeItemAtPath:_analyzerInProgressFile error:&error]; - } if (!BITHockeyBundle() && !bit_isRunningInAppExtension()) { NSLog(@"[HockeySDK] WARNING: %@ is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE); From a10fd552ecc9150759da5502ac6c4675086d63d8 Mon Sep 17 00:00:00 2001 From: Benjamin Reimold Date: Tue, 19 Jul 2016 10:31:21 -0700 Subject: [PATCH 05/16] Bump version number, write changelog, fix travis ci test matrix --- .travis.yml | 2 +- HockeySDK-Source.podspec | 4 ++-- HockeySDK.podspec | 2 +- README.md | 4 ++-- Support/buildnumber.xcconfig | 4 ++-- docs/Changelog-template.md | 6 ++++++ docs/Guide-Installation-Setup-template.md | 4 ++++ 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 83a1953d9a..8239d7f7eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: - SCHEME="HockeySDK" DESTINATION="OS=8.4,name=iPhone 6" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.0,name=iPad Air" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.0,name=iPhone 6 Plus" RUN_TESTS="YES" - - SCHEME="HockeySDK" DESTINATION="OS=9.1,name=iPad Pro" RUN_TESTS="YES" + - SCHEME="HockeySDK" DESTINATION="OS=9.2,name=iPad Pro" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.2,name=iPhone 6s" RUN_TESTS="YES" - SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,name=iPhone 6" RUN_TESTS="YES" - SCHEME="HockeySDK Distribution" RUN_TESTS="NO" LINT="YES" diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index a9cca54380..aeaaf808e2 100644 --- a/HockeySDK-Source.podspec +++ b/HockeySDK-Source.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK-Source' - s.version = '4.0.1' + s.version = '4.0.2' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.frameworks = 'AssetsLibrary', 'CoreGraphics', 'CoreTelephony', 'CoreText', 'MobileCoreServices', 'Photos', 'QuartzCore', 'QuickLook', 'Security', 'SystemConfiguration', 'UIKit' s.libraries = 'c++', 'z' s.vendored_frameworks = 'Vendor/CrashReporter.framework' - s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"60\\"" BITHOCKEY_C_BUILD="\\"60\\""} } + s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"85\\"" BITHOCKEY_C_BUILD="\\"85\\""} } s.resource_bundle = { 'HockeySDKResources' => ['Resources/*.png', 'Resources/*.lproj'] } s.preserve_paths = 'Resources', 'Support' s.private_header_files = 'Classes/*Private.h' diff --git a/HockeySDK.podspec b/HockeySDK.podspec index b3bd03736a..5c76e0f8bb 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK' - s.version = '4.0.1' + s.version = '4.0.2' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC diff --git a/README.md b/README.md index 26e989329c..a7dd28926c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK) -## Version 4.0.1 +## Version 4.0.2 -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.0.1/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.0.2/docs/docs/Changelog.html) NOTE: With the release of HockeySDK 4.0.0-alpha.1 a bug was introduced which lead to the exclusion of the Application Support folder from iCloud and iTunes backups. diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index b6b68c6c57..8037638c5a 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,7 +1,7 @@ #include "HockeySDK.xcconfig" -BUILD_NUMBER = 84 -VERSION_STRING = 4.0.1 +BUILD_NUMBER = 85 +VERSION_STRING = 4.0.2 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(HOCKEYSDK_GCC_PREPROCESSOR_DEFINITIONS) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" BIT_ARM_ARCHS = armv7 armv7s arm64 BIT_SIM_ARCHS = x86_64 i386 diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index ecf836f81f..717d53f6d6 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,3 +1,9 @@ + +## Version 4.0.2 + +- [BUGFIX] Add Bitcode marker back to simulator slices. This is necessary because otherwise `lipo` apparently strips the Bitcode sections from the merged library completely. As a side effect, this unfortunately breaks compatibility with Xcode 6. [#310](https://github.com/bitstadium/HockeySDK-iOS/pull/310) +- [IMPROVEMENT] Improve error detection and logging during crash processing in case the app is sent to the background while crash processing hasn't finished.[#311](https://github.com/bitstadium/HockeySDK-iOS/pull/311) + ## Version 4.0.1 - [BUGFIX] Fixes an issue where the whole app's Application Support directory was accidentally excluded from backups. diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index f3634eec4f..dc36e80acf 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -1,3 +1,7 @@ +## Version 4.0.2 + +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.0.2/docs/docs/Changelog.html) + ## Version 4.0.1 - [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.0.1/docs/docs/Changelog.html) From b284d9afd0449951db0d4ec3b18be71ed5fc1782 Mon Sep 17 00:00:00 2001 From: Benjamin Reimold Date: Tue, 19 Jul 2016 11:24:51 -0700 Subject: [PATCH 06/16] Add paragraph about @import for integration as source. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a7dd28926c..9bd95ae654 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,12 @@ Alternatively you can integrate the SDK by source if you want to do any modifica pod "HockeySDK-Source" ``` +The import for this integration will look slightly different: + +```objectivec +@import HockeySDK_Source; +``` + ### 3.3 Carthage From cfee15828e6903f283e2b7db1d029d1a97ba280b Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Tue, 19 Jul 2016 15:27:41 -0700 Subject: [PATCH 07/16] Add API to track events with properties and measurements --- Classes/BITDomain.m | 1 + Classes/BITEventData.h | 1 + Classes/BITEventData.m | 15 +++++++++++++++ Classes/BITMetricsManager.h | 11 +++++++++++ Classes/BITMetricsManager.m | 18 ++++++++++++++++++ Classes/BITTelemetryData.h | 1 + Classes/BITTelemetryData.m | 2 ++ 7 files changed, 49 insertions(+) diff --git a/Classes/BITDomain.m b/Classes/BITDomain.m index 8e15e4a8b1..dbe2adf31d 100644 --- a/Classes/BITDomain.m +++ b/Classes/BITDomain.m @@ -3,6 +3,7 @@ @implementation BITDomain @synthesize envelopeTypeName = _envelopeTypeName; @synthesize dataTypeName = _dataTypeName; +@synthesize properties = _properties; /// Initializes a new instance of the class. - (instancetype)init { diff --git a/Classes/BITEventData.h b/Classes/BITEventData.h index ed3e0b147b..50bb133330 100644 --- a/Classes/BITEventData.h +++ b/Classes/BITEventData.h @@ -4,5 +4,6 @@ @property (nonatomic, copy, readonly) NSString *envelopeTypeName; @property (nonatomic, copy, readonly) NSString *dataTypeName; +@property (nonatomic, strong) NSDictionary *measurements; @end diff --git a/Classes/BITEventData.m b/Classes/BITEventData.m index 1f86da1ba4..0c8dfd2195 100644 --- a/Classes/BITEventData.m +++ b/Classes/BITEventData.m @@ -5,6 +5,8 @@ @synthesize envelopeTypeName = _envelopeTypeName; @synthesize dataTypeName = _dataTypeName; @synthesize version = _version; +@synthesize properties = _properties; +@synthesize measurements = _measurements; /// Initializes a new instance of the class. - (instancetype)init { @@ -12,6 +14,8 @@ _envelopeTypeName = @"Microsoft.ApplicationInsights.Event"; _dataTypeName = @"EventData"; _version = @2; + _properties = [NSDictionary new]; + _measurements = [NSDictionary new]; } return self; } @@ -25,6 +29,13 @@ if (self.name != nil) { [dict setObject:self.name forKey:@"name"]; } + if (self.properties !=nil) { + [dict setObject:self.properties forKey:@"properties"]; + } + if (self.measurements) { + [dict setObject:self.measurements forKey:@"measurements"]; + } + return dict; } @@ -36,6 +47,8 @@ _envelopeTypeName = [coder decodeObjectForKey:@"self.envelopeTypeName"]; _dataTypeName = [coder decodeObjectForKey:@"self.dataTypeName"]; _version = [coder decodeObjectForKey:@"self.version"]; + _properties = [coder decodeObjectForKey:@"self.properties"]; + _measurements = [coder decodeObjectForKey:@"self.measurements"]; } return self; } @@ -45,6 +58,8 @@ [coder encodeObject:self.envelopeTypeName forKey:@"self.envelopeTypeName"]; [coder encodeObject:self.dataTypeName forKey:@"self.dataTypeName"]; [coder encodeObject:self.version forKey:@"self.version"]; + [coder encodeObject:self.properties forKey:@"self.properties"]; + [coder encodeObject:self.measurements forKey:@"self.measurements"]; } diff --git a/Classes/BITMetricsManager.h b/Classes/BITMetricsManager.h index 303143e107..e8e519282a 100644 --- a/Classes/BITMetricsManager.h +++ b/Classes/BITMetricsManager.h @@ -42,6 +42,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)trackEventWithName:(NSString *)eventName; +/** + * This method allows to track an event that happened in your app. + * Remember to choose meaningful event names to have the best experience when diagnosing your app + * in the web portal. + * + * @param eventName the name of the event, which should be tracked. + * @param properties key value pairs with additional info about the event. + * @param measurements key value pairs, which contain custom metrics. + */ +- (void)trackEventWithName:(NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements; + @end NS_ASSUME_NONNULL_END diff --git a/Classes/BITMetricsManager.m b/Classes/BITMetricsManager.m index 508921d793..ade58e15bc 100644 --- a/Classes/BITMetricsManager.m +++ b/Classes/BITMetricsManager.m @@ -192,6 +192,24 @@ static NSString *const BITMetricsURLPathString = @"v2/track"; }); } +- (void)trackEventWithName:(NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements { + if (!eventName) { return; } + if (self.disabled) { + BITHockeyLogDebug(@"INFO: BITMetricsManager is disabled, therefore this tracking call was ignored."); + return; + } + + __weak typeof(self) weakSelf = self; + dispatch_async(self.metricsEventQueue, ^{ + typeof(self) strongSelf = weakSelf; + BITEventData *eventData = [BITEventData new]; + [eventData setName:eventName]; + [eventData setProperties:properties]; + [eventData setMeasurements:measurements]; + [strongSelf trackDataItem:eventData]; + }); +} + #pragma mark Track DataItem - (void)trackDataItem:(BITTelemetryData *)dataItem { diff --git a/Classes/BITTelemetryData.h b/Classes/BITTelemetryData.h index b1a5d3d0fc..50539a1074 100644 --- a/Classes/BITTelemetryData.h +++ b/Classes/BITTelemetryData.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSNumber *version; @property (nonatomic, copy) NSString *name; +@property (nonatomic, strong) NSDictionary *properties; @end diff --git a/Classes/BITTelemetryData.m b/Classes/BITTelemetryData.m index b0f15bf409..ee524acb2e 100644 --- a/Classes/BITTelemetryData.m +++ b/Classes/BITTelemetryData.m @@ -18,6 +18,7 @@ if(self) { _version = [coder decodeObjectForKey:@"self.version"]; _name = [coder decodeObjectForKey:@"self.name"]; + _properties = [coder decodeObjectForKey:@"self.properties"]; } return self; } @@ -26,6 +27,7 @@ [super encodeWithCoder:coder]; [coder encodeObject:self.version forKey:@"self.version"]; [coder encodeObject:self.name forKey:@"self.name"]; + [coder encodeObject:self.properties forKey:@"self.properties"]; } @end From fde3f84d4297a13d4f5d16cb0300ab8d7a3e3c59 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 20 Jul 2016 14:36:39 -0700 Subject: [PATCH 08/16] Fix build errors related to BITHockeyLog --- Classes/BITCrashManager.m | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 5086092197..26c69f3a42 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -753,7 +753,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf * @param filename the crash reports temp filename */ - (void)storeMetaDataForCrashReportFilename:(NSString *)filename { - BITHockeyLog(@"VERBOSE: Storing meta data for crash report with filename %@", filename); + BITHockeyLogVerbose(@"VERBOSE: Storing meta data for crash report with filename %@", filename); NSError *error = NULL; NSMutableDictionary *metaDict = [NSMutableDictionary dictionaryWithCapacity:4]; NSString *applicationLog = @""; @@ -768,18 +768,18 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [metaDict setObject:applicationLog forKey:kBITCrashMetaApplicationLog]; if ([self.delegate respondsToSelector:@selector(attachmentForCrashManager:)]) { - BITHockeyLog(@"VERBOSE: Processing attachment for crash report with filename %@", filename); + BITHockeyLogVerbose(@"VERBOSE: Processing attachment for crash report with filename %@", filename); BITHockeyAttachment *attachment = [self.delegate attachmentForCrashManager:self]; if (attachment && attachment.hockeyAttachmentData) { BOOL success = [self persistAttachment:attachment withFilename:[_crashesDir stringByAppendingPathComponent: filename]]; if (!success) { - BITHockeyLog(@"ERROR: Persisting the crash attachment failed"); + BITHockeyLogError(@"ERROR: Persisting the crash attachment failed"); } else { - BITHockeyLog(@"VERBOSE: Crash attachment successfully persisted."); + BITHockeyLogVerbose(@"VERBOSE: Crash attachment successfully persisted."); } } else { - BITHockeyLog(@"INFO: Crash attachment was nil"); + BITHockeyLogDebug(@"INFO: Crash attachment was nil"); } } @@ -790,12 +790,12 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf if (plist) { BOOL success = [plist writeToFile:[_crashesDir stringByAppendingPathComponent: [filename stringByAppendingPathExtension:@"meta"]] atomically:YES]; if (!success) { - BITHockeyLog(@"ERROR: Writing crash meta data failed."); + BITHockeyLogError(@"ERROR: Writing crash meta data failed."); } } else { BITHockeyLogError(@"ERROR: Writing crash meta data failed. %@", error); } - BITHockeyLog(@"VERBOSE: Storing crash meta data finished."); + BITHockeyLogVerbose(@"VERBOSE: Storing crash meta data finished."); } - (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData { @@ -846,7 +846,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf * Parse the new crash report and gather additional meta data from the app which will be stored along the crash report */ - (void) handleCrashReport { - BITHockeyLog(@"VERBOSE: Handling crash report"); + BITHockeyLogVerbose(@"VERBOSE: Handling crash report"); NSError *error = NULL; if (!self.plCrashReporter) return; @@ -855,7 +855,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf if (![_fileManager fileExistsAtPath:_analyzerInProgressFile]) { // mark the start of the routine [_fileManager createFileAtPath:_analyzerInProgressFile contents:nil attributes:nil]; - BITHockeyLog(@"VERBOSE: AnalyzerInProgress file created"); + BITHockeyLogVerbose(@"VERBOSE: AnalyzerInProgress file created"); [self saveSettings]; @@ -912,7 +912,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } } } else { - BITHockeyLog(@"WARNING: AnalyzerInProgress file found, handling crash report skipped"); + BITHockeyLogWarning(@"WARNING: AnalyzerInProgress file found, handling crash report skipped"); } // Purge the report @@ -1001,7 +1001,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } - (void)triggerDelayedProcessing { - BITHockeyLog(@"VERBOE: Triggering delayed crash processing."); + BITHockeyLogVerbose(@"VERBOSE: Triggering delayed crash processing."); [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invokeDelayedProcessing) object:nil]; [self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5]; } @@ -1257,7 +1257,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf } if (considerReport) { - BITHockeyLog(@"INFO: App kill detected, creating crash report."); + BITHockeyLogVerbose(@"INFO: App kill detected, creating crash report."); [self createCrashReportForAppKill]; _didCrashInLastSession = YES; @@ -1277,7 +1277,7 @@ static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInf [[NSUserDefaults standardUserDefaults] synchronize]; [self triggerDelayedProcessing]; - BITHockeyLog(@"VERBOSE: CrashManager startManager has finished."); + BITHockeyLogVerbose(@"VERBOSE: CrashManager startManager has finished."); } /** From 315e4d66515fdec6b73784c9aecbcf03237d7da4 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 20 Jul 2016 15:33:00 -0700 Subject: [PATCH 09/16] Bump version number, add changelog and update readme --- HockeySDK-Source.podspec | 2 +- HockeySDK.podspec | 2 +- README.md | 38 ++++++++++++++++++++++++++++++++++-- Support/buildnumber.xcconfig | 4 ++-- docs/Changelog-template.md | 5 +++++ 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index bc3bf00c21..a205968b7e 100644 --- a/HockeySDK-Source.podspec +++ b/HockeySDK-Source.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK-Source' - s.version = '4.1.0-beta.2' + s.version = '4.1.0-beta.3' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC diff --git a/HockeySDK.podspec b/HockeySDK.podspec index f86952d802..9683dc67a7 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK' - s.version = '4.1.0-beta.2' + s.version = '4.1.0-beta.3' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC diff --git a/README.md b/README.md index 1698e00fe8..ed0e319514 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK) -## Version 4.1.0-beta.2 +## Version 4.1.0-beta.3 -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.0-beta.2/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.0-beta.3/docs/docs/Changelog.html) **NOTE:** With the release of HockeySDK 4.0.0-alpha.1 a bug was introduced which lead to the exclusion of the Application Support folder from iCloud and iTunes backups. @@ -453,6 +453,40 @@ metricsManager.trackEventWithName(eventName) - There is currently a limit of 300 unique event names per app per week. - There is _no_ limit on the number of times an event can happen. +### 3.7.2 Attaching custom properties and measurements to a custom event + +It's possible to attach porperties and/or measurements to a custom event. + +- Properties have to be a string. +- Measurements have to be of a numeric type. + +**Objective-C** + +```objectivec +BITMetricsManager *metricsManager = [BITHockeyManager sharedHockeyManager].metricsManager; + +NSDictionary *myProperties = @{@"Property 1" : @"Something", + @"Property 2" : @"Other thing", + @"Property 3" : @"Totally different thing"}; +NSDictionary *myMeasurements = @{@"Measurement 1" : @1, + @"Measurement 2" : @2.34, + @"Measurement 3" : @2000000}; + +[metricsManager trackEventWithName:eventName properties:myProperties measurements:myMeasurements] +``` + +**Swift** + +```swift + +let myProperties = ["Property 1": "Something", "Property 2": "Other thing", "Property 3" : "Totally different thing."] +let myMeasurements = ["Measurement 1": 1, "Measurement 2": 2.3, "Measurement 3" : 30000] + +let metricsManager = BITHockeyManager.sharedHockeyManager().metricsManager +metricsManager.trackEventWithName(eventName, properties: myProperties, myMeasurements: measurements) +``` + + ### 3.8 Feedback diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index 85262e6253..f07f56b11e 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,7 +1,7 @@ #include "HockeySDK.xcconfig" -BUILD_NUMBER = 94 -VERSION_STRING = 4.1.0-beta.2 +BUILD_NUMBER = 95 +VERSION_STRING = 4.1.0-beta.3 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(HOCKEYSDK_GCC_PREPROCESSOR_DEFINITIONS) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" BIT_ARM_ARCHS = armv7 armv7s arm64 BIT_SIM_ARCHS = x86_64 i386 diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 0e0252696f..06e4cc76ba 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,3 +1,8 @@ +## 4.1.0-beta.3 + +- Includes improvements from 4.0.2 release of the SDK. +- [NEW] Additional API to track an event with properties and measurements. + ## 4.1.0-beta.2 - [BUGFIX] Fixes an issue where the whole app's Application Support directory was accidentally excluded from backups. From c9525f82cd9d72cd5877bc3c3bb8906f07ca43cb Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 3 Aug 2016 15:45:58 -0700 Subject: [PATCH 10/16] Address comments to PR by Lumaxis --- HockeySDK-Source.podspec | 2 +- README.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index a205968b7e..76c012bb60 100644 --- a/HockeySDK-Source.podspec +++ b/HockeySDK-Source.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.frameworks = 'AssetsLibrary', 'CoreGraphics', 'CoreTelephony', 'CoreText', 'MobileCoreServices', 'Photos', 'QuartzCore', 'QuickLook', 'Security', 'SystemConfiguration', 'UIKit' s.libraries = 'c++', 'z' s.vendored_frameworks = 'Vendor/CrashReporter.framework' - s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"85\\"" BITHOCKEY_C_BUILD="\\"85\\""} } + s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"95\\"" BITHOCKEY_C_BUILD="\\"95\\""} } s.resource_bundle = { 'HockeySDKResources' => ['Resources/*.png', 'Resources/*.lproj'] } s.preserve_paths = 'Resources', 'Support' s.private_header_files = 'Classes/*Private.h' diff --git a/README.md b/README.md index ed0e319514..1fecf7595f 100644 --- a/README.md +++ b/README.md @@ -478,7 +478,6 @@ NSDictionary *myMeasurements = @{@"Measurement 1" : @1, **Swift** ```swift - let myProperties = ["Property 1": "Something", "Property 2": "Other thing", "Property 3" : "Totally different thing."] let myMeasurements = ["Measurement 1": 1, "Measurement 2": 2.3, "Measurement 3" : 30000] From 4ec5a6b1faed472caaa62951561395d5d8c25cba Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Mon, 22 Aug 2016 14:02:35 -0700 Subject: [PATCH 11/16] Rename version to 4.1.0 --- README.md | 12 ++++++------ Support/buildnumber.xcconfig | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1fecf7595f..d64266d882 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK) -## Version 4.1.0-beta.3 +## Version 4.1.0 -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.0-beta.3/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.0/docs/docs/Changelog.html) **NOTE:** With the release of HockeySDK 4.0.0-alpha.1 a bug was introduced which lead to the exclusion of the Application Support folder from iCloud and iTunes backups. -If you have been using one of the affected versions (4.0.0-alpha.2, Version 4.0.0-beta.1, 4.0.0, 4.1.0-alpha.1, 4.1.0-alpha.2, or Version 4.1.0-beta.1), please make sure to update to at least version 4.0.1 or 4.1.0-beta.2 of our SDK as soon as you can. +If you have been using one of the affected versions (4.0.0-alpha.2, Version 4.0.0-beta.1, 4.0.0, 4.1.0-alpha.1, 4.1.0-alpha.2, or Version 4.1.0-beta.1), please make sure to update to at least version 4.0.1 of our SDK as soon as you can. ## Introduction @@ -18,7 +18,7 @@ The following features are currently supported: 1. **Collect crash reports:** If your app crashes, a crash log with the same format as from the Apple Crash Reporter is written to the device's storage. If the user starts the app again, he is asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. -2. **User Metrics:** Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. If you are part of [Preseason](hockeyapp.net/preseason), you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. +2. **User Metrics:** Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count.You can now track **Custom Events** in your app, understand user actions and see the aggregates on the HockeyApp portal. 3. **Update Ad-Hoc / Enterprise apps:** The app will check with HockeyApp if a new version for your Ad-Hoc or Enterprise build is available. If yes, it will show an alert view to the user and let him see the release notes, the version history and start the installation process right away. @@ -557,7 +557,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK ## 4. Documentation -Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.0-beta.2/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.0/index.html). ## 5.Troubleshooting @@ -571,7 +571,7 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/ Make sure none of the following files are copied into your app bundle, check under app target, `Build Phases`, `Copy Bundle Resources` or in the `.app` bundle after building: - `HockeySDK.framework` (except if you build a dynamic framework version of the SDK yourself!) - - `de.bitstadium.HockeySDK-iOS-4.1.0-beta.2.docset` + - `de.bitstadium.HockeySDK-iOS-4.1.0.docset` ### Feature are not working as expected diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index f07f56b11e..2e99ca24cb 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,7 +1,7 @@ #include "HockeySDK.xcconfig" BUILD_NUMBER = 95 -VERSION_STRING = 4.1.0-beta.3 +VERSION_STRING = 4.1.0 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(HOCKEYSDK_GCC_PREPROCESSOR_DEFINITIONS) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" BIT_ARM_ARCHS = armv7 armv7s arm64 BIT_SIM_ARCHS = x86_64 i386 From 083119aa08f2c7592f259d0a06e1a2f41fb26992 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Mon, 22 Aug 2016 14:19:06 -0700 Subject: [PATCH 12/16] Bump version in podfiles --- HockeySDK-Source.podspec | 2 +- HockeySDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index 76c012bb60..b0fca4972d 100644 --- a/HockeySDK-Source.podspec +++ b/HockeySDK-Source.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK-Source' - s.version = '4.1.0-beta.3' + s.version = '4.1.0' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC diff --git a/HockeySDK.podspec b/HockeySDK.podspec index 9683dc67a7..07f5915da9 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK' - s.version = '4.1.0-beta.3' + s.version = '4.1.0' s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.' s.description = <<-DESC From c14863e62fbebbf391f62afab3d82af88a1bb4be Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Mon, 22 Aug 2016 14:38:16 -0700 Subject: [PATCH 13/16] Version bump in changelog template --- docs/Changelog-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 06e4cc76ba..cf83a14b24 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,4 +1,4 @@ -## 4.1.0-beta.3 +## 4.1.0 - Includes improvements from 4.0.2 release of the SDK. - [NEW] Additional API to track an event with properties and measurements. From fca531fec9b6a7e82032a2473e0925c0f0445621 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Mon, 22 Aug 2016 14:48:46 -0700 Subject: [PATCH 14/16] Update Changelog Template with content from 4.0.2 --- docs/Changelog-template.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index cf83a14b24..5a8d3b2b69 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -43,6 +43,11 @@ This SDK release explicitly includes the Application Support directory into back - [IMPROVEMENT] Reuse `NSURLSession` object - [IMPROVEMENT] Under the hood improvements and cleanup +## Version 4.0.2 + +- [BUGFIX] Add Bitcode marker back to simulator slices. This is necessary because otherwise `lipo` apparently strips the Bitcode sections from the merged library completely. As a side effect, this unfortunately breaks compatibility with Xcode 6. [#310](https://github.com/bitstadium/HockeySDK-iOS/pull/310) +- [IMPROVEMENT] Improve error detection and logging during crash processing in case the app is sent to the background while crash processing hasn't finished.[#311](https://github.com/bitstadium/HockeySDK-iOS/pull/311) + ## Version 4.0.1 - [BUGFIX] Fixes an issue where the whole app's Application Support directory was accidentally excluded from backups. From 448ed1b2940be97a5cd341ccdff37227e962fee0 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Tue, 23 Aug 2016 12:48:53 -0700 Subject: [PATCH 15/16] Fix formatting of section about attaching custom properties --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d64266d882..ec977b4dab 100644 --- a/README.md +++ b/README.md @@ -453,7 +453,7 @@ metricsManager.trackEventWithName(eventName) - There is currently a limit of 300 unique event names per app per week. - There is _no_ limit on the number of times an event can happen. -### 3.7.2 Attaching custom properties and measurements to a custom event +#### 3.7.2 Attaching custom properties and measurements to a custom event It's possible to attach porperties and/or measurements to a custom event. From f31b47545c85eb4c98ac1032e4da52b4eeba10ae Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Tue, 23 Aug 2016 13:58:09 -0700 Subject: [PATCH 16/16] use generics for better swift imports --- Classes/BITMetricsManager.h | 4 ++-- Classes/BITMetricsManager.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/BITMetricsManager.h b/Classes/BITMetricsManager.h index e8e519282a..6d5e3f2d5f 100644 --- a/Classes/BITMetricsManager.h +++ b/Classes/BITMetricsManager.h @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param eventName The event's name as a string. */ -- (void)trackEventWithName:(NSString *)eventName; +- (void)trackEventWithName:(nonnull NSString *)eventName; /** * This method allows to track an event that happened in your app. @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN * @param properties key value pairs with additional info about the event. * @param measurements key value pairs, which contain custom metrics. */ -- (void)trackEventWithName:(NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements; +- (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements; @end diff --git a/Classes/BITMetricsManager.m b/Classes/BITMetricsManager.m index ade58e15bc..8e4798fe0b 100644 --- a/Classes/BITMetricsManager.m +++ b/Classes/BITMetricsManager.m @@ -176,7 +176,7 @@ static NSString *const BITMetricsURLPathString = @"v2/track"; #pragma mark Events -- (void)trackEventWithName:(NSString *)eventName { +- (void)trackEventWithName:(nonnull NSString *)eventName { if (!eventName) { return; } if (self.disabled) { BITHockeyLogDebug(@"INFO: BITMetricsManager is disabled, therefore this tracking call was ignored."); @@ -192,7 +192,7 @@ static NSString *const BITMetricsURLPathString = @"v2/track"; }); } -- (void)trackEventWithName:(NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements { +- (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements { if (!eventName) { return; } if (self.disabled) { BITHockeyLogDebug(@"INFO: BITMetricsManager is disabled, therefore this tracking call was ignored.");