From 71de3c14f76086d22cf4d68c12ea4d8b53a1f0f0 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 3 May 2017 15:35:21 -0700 Subject: [PATCH 01/25] Disable Metrics config flag in crashonly builds --- Support/crashonly.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Support/crashonly.xcconfig b/Support/crashonly.xcconfig index 8cd6af47..3eb31630 100644 --- a/Support/crashonly.xcconfig +++ b/Support/crashonly.xcconfig @@ -1,3 +1,3 @@ #include "HockeySDKBase.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) HOCKEYSDK_FEATURE_CRASH_REPORTER=1 HOCKEYSDK_FEATURE_FEEDBACK=0 HOCKEYSDK_FEATURE_STORE_UPDATES=0 HOCKEYSDK_FEATURE_AUTHENTICATOR=0 HOCKEYSDK_FEATURE_UPDATES=0 HOCKEYSDK_FEATURE_METRICS=1 BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HOCKEYSDK_CONFIGURATION_$(CONFIGURATION) HOCKEYSDK_FEATURE_CRASH_REPORTER=1 HOCKEYSDK_FEATURE_FEEDBACK=0 HOCKEYSDK_FEATURE_STORE_UPDATES=0 HOCKEYSDK_FEATURE_AUTHENTICATOR=0 HOCKEYSDK_FEATURE_UPDATES=0 HOCKEYSDK_FEATURE_METRICS=0 BITHOCKEY_VERSION="@\""$(VERSION_STRING)"\"" BITHOCKEY_BUILD="@\""$(BUILD_NUMBER)"\"" BITHOCKEY_C_VERSION="\""$(VERSION_STRING)"\"" BITHOCKEY_C_BUILD="\""$(BUILD_NUMBER)"\"" From 34fb2e36dc6aa09e4b947b2860097950f5264fa6 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Fri, 19 May 2017 11:39:44 +0200 Subject: [PATCH 02/25] =?UTF-8?q?Improve=20error=20logging=20to=20make=20s?= =?UTF-8?q?ure=20we=20don=E2=80=99t=20log=20an=20error=20in=20case=20we=20?= =?UTF-8?q?run=20in=20a=20xamarin=20environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/BITCrashManager.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index e04efa39..1e892dce 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -1042,7 +1042,7 @@ - (void)invokeDelayedProcessing { // If the top level error handler differs from our own, then at least another one was added. // This could cause exception crashes not to be reported to HockeyApp. See log message for details. if (self.exceptionHandler != currentHandler) { - BITHockeyLogWarning(@"[HockeySDK] WARNING: Another exception handler was added. If this invokes any kind exit() after processing the exception, which causes any subsequent error handler not to be invoked, these crashes will NOT be reported to HockeyApp!"); + BITHockeyLogWarning(@"[HockeySDK] WARNING: Another exception handler was added. If this invokes any kind of exit() after processing the exception, which causes any subsequent error handler not to be invoked, these crashes will NOT be reported to HockeyApp!"); } } @@ -1261,8 +1261,13 @@ - (void)startManagerInSdkEnvironment:(BITSdkEnvironment)sdkEnvironment { BITHockeyLogDebug(@"INFO: Exception handler successfully initialized."); } else { - // this should never happen, theoretically only if NSSetUncaugtExceptionHandler() has some internal issues - BITHockeyLogError(@"[HockeySDK] ERROR: Exception handler could not be set. Make sure there is no other exception handler set up!"); + + // If we're running in a Xamarin Environment, the exception handler will be the one by the xamarin runtime, not ours. + // So only make sure we're logging the error in a non-xamarin environment. + if(sdkEnvironment != BITSdkEnvironmentXamarin) { + // this should never happen, theoretically only if NSSetUncaugtExceptionHandler() has some internal issues + BITHockeyLogError(@"[HockeySDK] ERROR: Exception handler could not be set. Make sure there is no other exception handler set up!"); + } } // Add the C++ uncaught exception handler, which is currently not handled by PLCrashReporter internally From a9f2c6610f25fc063567b2cefa72cd9f292d528f Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 24 May 2017 11:16:30 +0200 Subject: [PATCH 03/25] Undo changes related to Xamarin SDK fixes --- Classes/BITCrashManager.m | 35 ++++++-------------------------- Classes/BITCrashManagerPrivate.h | 2 -- Classes/BITHockeyManager.h | 13 ------------ Classes/BITHockeyManager.m | 19 +---------------- Classes/HockeySDKEnums.h | 14 ------------- 5 files changed, 7 insertions(+), 76 deletions(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 1e892dce..391363b9 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -1154,18 +1154,10 @@ - (void)invokeDelayedProcessing { } } -- (void)startManagerInXamarinEnvironment { - [self startManagerInSdkEnvironment:BITSdkEnvironmentXamarin]; -} - -- (void)startManager { - [self startManagerInSdkEnvironment:BITSdkEnvironmentNative]; -} - /** * Main startup sequence initializing PLCrashReporter if it wasn't disabled */ -- (void)startManagerInSdkEnvironment:(BITSdkEnvironment)sdkEnvironment { +- (void)startManager { if (_crashManagerStatus == BITCrashManagerStatusDisabled) return; [self registerObservers]; @@ -1187,21 +1179,8 @@ - (void)startManagerInSdkEnvironment:(BITSdkEnvironment)sdkEnvironment { symbolicationStrategy = PLCrashReporterSymbolicationStrategyAll; } - BITPLCrashReporterConfig *config; - - switch (sdkEnvironment) { - case BITSdkEnvironmentXamarin: - config = [[BITPLCrashReporterConfig alloc] initWithSignalHandlerType: signalHandlerType - symbolicationStrategy: symbolicationStrategy - shouldRegisterUncaughtExceptionHandler:NO]; - - break; - default: - config = [[BITPLCrashReporterConfig alloc] initWithSignalHandlerType: signalHandlerType - symbolicationStrategy: symbolicationStrategy]; - break; - } - + BITPLCrashReporterConfig *config = [[BITPLCrashReporterConfig alloc] initWithSignalHandlerType: signalHandlerType + symbolicationStrategy: symbolicationStrategy]; self.plCrashReporter = [[BITPLCrashReporter alloc] initWithConfiguration: config]; // Check if we previously crashed @@ -1263,11 +1242,9 @@ - (void)startManagerInSdkEnvironment:(BITSdkEnvironment)sdkEnvironment { } else { // If we're running in a Xamarin Environment, the exception handler will be the one by the xamarin runtime, not ours. - // So only make sure we're logging the error in a non-xamarin environment. - if(sdkEnvironment != BITSdkEnvironmentXamarin) { - // this should never happen, theoretically only if NSSetUncaugtExceptionHandler() has some internal issues - BITHockeyLogError(@"[HockeySDK] ERROR: Exception handler could not be set. Make sure there is no other exception handler set up!"); - } + // In other cases, this should never happen, theoretically only if NSSetUncaugtExceptionHandler() has some internal issues + BITHockeyLogError(@"[HockeySDK] ERROR: Exception handler could not be set. Make sure there is no other exception handler set up!"); + BITHockeyLogError(@"[HockeySDK] ERROR: If you are using the HockeySDK-Xamarin, this is expected behavior and you can ignore this message"); } // Add the C++ uncaught exception handler, which is currently not handled by PLCrashReporter internally diff --git a/Classes/BITCrashManagerPrivate.h b/Classes/BITCrashManagerPrivate.h index b8954c52..75ecf3ce 100644 --- a/Classes/BITCrashManagerPrivate.h +++ b/Classes/BITCrashManagerPrivate.h @@ -85,8 +85,6 @@ - (instancetype)initWithAppIdentifier:(NSString *)appIdentifier appEnvironment:(BITEnvironment)environment hockeyAppClient:(BITHockeyAppClient *)hockeyAppClient NS_DESIGNATED_INITIALIZER; -- (void)startManagerInXamarinEnvironment; - - (void)cleanCrashReports; - (NSString *)userIDForCrashReport; diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index f7b4aac8..fd673f26 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -191,19 +191,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)startManager; -/** - Starts the manager and runs all modules from a Xamarin environment. This is intended to be used by the HockeySDK-Xamarin. - We now need to make a difference as BITCrashManager needs to setup PLCrashReporter differently for Xamarin apps. - - @warning Do not use this API from within a native iOS app. - - Call this after configuring the manager and setting up all modules. - - @see configureWithIdentifier:delegate: - @see configureWithBetaIdentifier:liveIdentifier:delegate: - */ -- (void)startManagerInXamarinEnvironment; - #pragma mark - Public Properties ///----------------------------------------------------------------------------- diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 6a596da1..52c23509 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -220,15 +220,6 @@ - (void)configureWithBetaIdentifier:(NSString *)betaIdentifier liveIdentifier:(N } - (void)startManager { - [self startManagerWithEnvironment:BITSdkEnvironmentNative]; -} - -- (void)startManagerInXamarinEnvironment { - [self startManagerWithEnvironment:BITSdkEnvironmentXamarin]; - BITHockeyLogVerbose(@"Started the BITHockeyManager with Xamarin Environment."); -} - -- (void)startManagerWithEnvironment:(BITSdkEnvironment)sdkEnvironment { if (!_validAppIdentifier) return; if (_startManagerIsInvoked) { BITHockeyLogWarning(@"[HockeySDK] Warning: startManager should only be invoked once! This call is ignored."); @@ -262,15 +253,7 @@ - (void)startManagerWithEnvironment:(BITSdkEnvironment)sdkEnvironment { } #endif - // Start BITCrashManager with the environment flag to make sure we don't break NSException reporting for Xamarin. - switch (sdkEnvironment) { - case BITSdkEnvironmentXamarin: - [_crashManager startManagerInXamarinEnvironment]; - break; - default: - [_crashManager startManager]; - break; - } + [_crashManager startManager]; } #endif /* HOCKEYSDK_FEATURE_CRASH_REPORTER */ diff --git a/Classes/HockeySDKEnums.h b/Classes/HockeySDKEnums.h index 180ddc8f..9caa3dbc 100644 --- a/Classes/HockeySDKEnums.h +++ b/Classes/HockeySDKEnums.h @@ -184,18 +184,4 @@ typedef NS_ENUM(NSInteger, BITHockeyErrorReason) { BITHockeyErrorUnknown }; -/** - * SDK Environment - */ -typedef NS_ENUM (NSUInteger, BITSdkEnvironment) { - /** - * A regular native iOS environment - */ - BITSdkEnvironmentNative = 0, - /** - * A xamarin environment - */ - BITSdkEnvironmentXamarin = 1 -}; - #endif /* HockeySDK_HockeyEnums_h */ From 6a23f12f996689db7dbc6464c111d58db311b552 Mon Sep 17 00:00:00 2001 From: Piet Brauer Date: Tue, 6 Jun 2017 09:07:53 -0700 Subject: [PATCH 04/25] Remove LIBCXXABI_NORETURN for now --- Classes/BITCrashCXXExceptionHandler.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/BITCrashCXXExceptionHandler.mm b/Classes/BITCrashCXXExceptionHandler.mm index d4e8ab03..c0228693 100644 --- a/Classes/BITCrashCXXExceptionHandler.mm +++ b/Classes/BITCrashCXXExceptionHandler.mm @@ -58,7 +58,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager -extern "C" void LIBCXXABI_NORETURN __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) +extern "C" void __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) { // Purposely do not take a lock in this function. The aim is to be as fast as // possible. While we could really use some of the info set up by the real @@ -72,7 +72,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager // implementation changing in a future version. (Or not existing in an earlier // version). - typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)) LIBCXXABI_NORETURN; + typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)); static dispatch_once_t predicate = 0; static cxa_throw_func __original__cxa_throw = nullptr; static const void **__real_objc_ehtype_vtable = nullptr; From 66391c173351c8fe8e2bb1487402035fdfa28430 Mon Sep 17 00:00:00 2001 From: Stephan Diederich Date: Tue, 6 Jun 2017 22:40:12 -0700 Subject: [PATCH 05/25] bump the schemes and project --- Support/HockeySDK.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/HockeySDK Distribution.xcscheme | 2 +- .../xcshareddata/xcschemes/HockeySDK Documentation.xcscheme | 2 +- .../xcshareddata/xcschemes/HockeySDK Framework.xcscheme | 2 +- .../xcshareddata/xcschemes/HockeySDK.xcscheme | 6 +++--- .../xcshareddata/xcschemes/HockeySDKResources.xcscheme | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index fc8ddee6..8f0e03f6 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -1612,7 +1612,7 @@ isa = PBXProject; attributes = { LastTestingUpgradeCheck = 0600; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; TargetAttributes = { 1EB6173E1B0A30480035A986 = { CreatedOnToolsVersion = 6.3.1; diff --git a/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDK Distribution.xcscheme b/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDK Distribution.xcscheme index 0480895a..d3b5ed78 100644 --- a/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDK Distribution.xcscheme +++ b/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDK Distribution.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES"> diff --git a/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDKResources.xcscheme b/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDKResources.xcscheme index a6f95d06..9d78c641 100644 --- a/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDKResources.xcscheme +++ b/Support/HockeySDK.xcodeproj/xcshareddata/xcschemes/HockeySDKResources.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 6 Jun 2017 22:40:47 -0700 Subject: [PATCH 06/25] fix warning new Xcode default warnings complains about missing voids in function prototypes. --- Classes/BITCrashManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/BITCrashManager.h b/Classes/BITCrashManager.h index 1ac1c187..0c3a4a33 100644 --- a/Classes/BITCrashManager.h +++ b/Classes/BITCrashManager.h @@ -39,7 +39,7 @@ /** * Custom block that handles the alert that prompts the user whether he wants to send crash reports */ -typedef void(^BITCustomAlertViewHandler)(); +typedef void(^BITCustomAlertViewHandler)(void); /** From 94df35d489dbc24cbc6252a6d2fe4d09ce9ccbef Mon Sep 17 00:00:00 2001 From: Piet Brauer Date: Wed, 7 Jun 2017 09:11:23 -0700 Subject: [PATCH 07/25] Revert "Remove LIBCXXABI_NORETURN for now" This reverts commit 6a23f12f996689db7dbc6464c111d58db311b552. --- Classes/BITCrashCXXExceptionHandler.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/BITCrashCXXExceptionHandler.mm b/Classes/BITCrashCXXExceptionHandler.mm index c0228693..d4e8ab03 100644 --- a/Classes/BITCrashCXXExceptionHandler.mm +++ b/Classes/BITCrashCXXExceptionHandler.mm @@ -58,7 +58,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager -extern "C" void __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) +extern "C" void LIBCXXABI_NORETURN __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) { // Purposely do not take a lock in this function. The aim is to be as fast as // possible. While we could really use some of the info set up by the real @@ -72,7 +72,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager // implementation changing in a future version. (Or not existing in an earlier // version). - typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)); + typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)) LIBCXXABI_NORETURN; static dispatch_once_t predicate = 0; static cxa_throw_func __original__cxa_throw = nullptr; static const void **__real_objc_ehtype_vtable = nullptr; From f6313ae5cbc4cb36c8bd8b0689329b69be4a7da4 Mon Sep 17 00:00:00 2001 From: Piet Brauer Date: Wed, 7 Jun 2017 09:11:54 -0700 Subject: [PATCH 08/25] Use __attribute__((noreturn)) --- Classes/BITCrashCXXExceptionHandler.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/BITCrashCXXExceptionHandler.mm b/Classes/BITCrashCXXExceptionHandler.mm index d4e8ab03..1474c9bc 100644 --- a/Classes/BITCrashCXXExceptionHandler.mm +++ b/Classes/BITCrashCXXExceptionHandler.mm @@ -58,7 +58,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager -extern "C" void LIBCXXABI_NORETURN __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) +extern "C" void __attribute__((noreturn)) __cxa_throw(void *exception_object, std::type_info *tinfo, void (*dest)(void *)) { // Purposely do not take a lock in this function. The aim is to be as fast as // possible. While we could really use some of the info set up by the real @@ -72,7 +72,7 @@ @implementation BITCrashUncaughtCXXExceptionHandlerManager // implementation changing in a future version. (Or not existing in an earlier // version). - typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)) LIBCXXABI_NORETURN; + typedef void (*cxa_throw_func)(void *, std::type_info *, void (*)(void *)) __attribute__((noreturn)); static dispatch_once_t predicate = 0; static cxa_throw_func __original__cxa_throw = nullptr; static const void **__real_objc_ehtype_vtable = nullptr; From 66d163ea5fc2d1190dcee970169559140f81a93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Fri, 9 Jun 2017 17:33:57 +0200 Subject: [PATCH 09/25] Remove manual unlinking of Carthage on Travis This hopefully fixes a CI failure for the Distribution target --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20ce53e4..ecebb9d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,6 @@ before_install: - gem install xcpretty --no-rdoc --no-ri --no-document --quiet - gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - - brew unlink carthage - brew install carthage script: @@ -55,4 +54,4 @@ after_failure: - cat xcodebuild.log - cat -n $TMPDIR/com.apple.dt.XCTest-status/Session*.log - cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash - - sleep 5 \ No newline at end of file + - sleep 5 From 28956c4d51a6dfec653cd5ff14875ce83ceaf1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Fri, 9 Jun 2017 20:43:11 +0200 Subject: [PATCH 10/25] Use iOS 10.3.1 on Travis instead of 10.3 Travis moved to 10.3.1, hence our required destinations now don't exist anymore. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecebb9d9..35ffb926 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ env: - SCHEME="HockeySDK" DESTINATION="OS=9.0,name=iPad Air" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.1,name=iPhone 6 Plus" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=10.2,name=iPad Pro (9.7-inch)" RUN_TESTS="YES" - - SCHEME="HockeySDK" DESTINATION="OS=10.3,name=iPhone 6s" RUN_TESTS="YES" - - SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,OS=10.3,name=iPhone 6" RUN_TESTS="YES" + - SCHEME="HockeySDK" DESTINATION="OS=10.3.1,name=iPhone 6s" RUN_TESTS="YES" + - SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 6" RUN_TESTS="YES" - SCHEME="HockeySDK Distribution" RUN_TESTS="NO" LINT="YES" before_install: From a79bd84127dae641210b64f6b93e30562be77662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Tue, 13 Jun 2017 00:10:47 +0200 Subject: [PATCH 11/25] Use gender-neutral language everywhere --- Classes/BITCrashManager.h | 6 +++--- Classes/BITFeedbackManager.m | 2 +- README.md | 2 +- docs/Guide-Installation-Setup-template.md | 2 +- docs/index.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Classes/BITCrashManager.h b/Classes/BITCrashManager.h index 0c3a4a33..69e7500f 100644 --- a/Classes/BITCrashManager.h +++ b/Classes/BITCrashManager.h @@ -37,7 +37,7 @@ /** - * Custom block that handles the alert that prompts the user whether he wants to send crash reports + * Custom block that handles the alert that prompts the user whether they want to send crash reports */ typedef void(^BITCustomAlertViewHandler)(void); @@ -340,7 +340,7 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) { /** Lets you set a custom block which handles showing a custom UI and asking the user - whether he wants to send the crash report. + whether they want to send the crash report. This replaces the default alert the SDK would show! @@ -350,7 +350,7 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) { In addition to this you should always ask your users if they agree to send crash reports, send them always or not and return the result when calling `handleUserInput:withUserProvidedCrashDescription`. - @param alertViewHandler A block that is responsible for loading, presenting and and dismissing your custom user interface which prompts the user if he wants to send crash reports. The block is also responsible for triggering further processing of the crash reports. + @param alertViewHandler A block that is responsible for loading, presenting and and dismissing your custom user interface which prompts the user if they want to send crash reports. The block is also responsible for triggering further processing of the crash reports. @warning This is not available when compiled for Watch OS! diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index d8d7e487..8343d4b2 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -822,7 +822,7 @@ - (void)updateMessageListFromResponse:(NSDictionary *)jsonDictionary { // we got a new incoming message, trigger user notification system if (newMessage) { - // check if the latest message is from the users own email address, then don't show an alert since he answered using his own email + // check if the latest message is from the users own email address, then don't show an alert since they answered using their own email BOOL latestMessageFromUser = NO; BITFeedbackMessage *latestMessage = [self lastMessageHavingID]; diff --git a/README.md b/README.md index 84073580..a0424b00 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ HockeySDK-iOS implements support for using HockeyApp in your iOS applications. 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. +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, they are 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.You can now track **Custom Events** in your app, understand user actions and see the aggregates on the HockeyApp portal. diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index 1cb7f841..e0370481 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -21,7 +21,7 @@ HockeySDK-iOS implements support for using HockeyApp in your iOS applications. 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. +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, they are 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.You can now track **Custom Events** in your app, understand user actions and see the aggregates on the HockeyApp portal. diff --git a/docs/index.md b/docs/index.md index 7456d7de..37ed2a0f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ HockeySDK-iOS implements support for using HockeyApp in your iOS applications. The following features are currently supported: -1. **Collect crash reports:** If you 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! +1. **Collect crash reports:** If you 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, they are 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. From 46cde6f2d6de698ae2426c8cfd313a817cda9fec Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Tue, 13 Jun 2017 22:57:23 -0700 Subject: [PATCH 12/25] Use fixes from https://github.com/bitstadium/HockeySDK-iOS/pull/417 and trigger reload of content in tableview to fix UI glitch --- Classes/BITFeedbackListViewController.m | 1 + Classes/BITFeedbackManager.m | 1 + Classes/BITFeedbackMessageAttachment.m | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 710ca827..25bcb757 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -652,6 +652,7 @@ - (void)handleResponseForAttachment:(BITFeedbackMessageAttachment *)attachment r [attachment replaceData:responseData]; [[NSNotificationCenter defaultCenter] postNotificationName:kBITFeedbackUpdateAttachmentThumbnail object:attachment]; [[BITHockeyManager sharedHockeyManager].feedbackManager saveMessages]; + [self.tableView reloadData]; }); } } diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index 8343d4b2..b822f8a8 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -780,6 +780,7 @@ - (void)updateMessageListFromResponse:(NSDictionary *)jsonDictionary { int attachmentIndex = 0; for (BITFeedbackMessageAttachment *attachment in matchingSendInProgressOrInConflictMessage.attachments) { attachment.identifier = feedbackAttachments[attachmentIndex][@"id"]; + attachment.sourceURL = feedbackAttachments[attachmentIndex][@"url"]; attachmentIndex++; } } diff --git a/Classes/BITFeedbackMessageAttachment.m b/Classes/BITFeedbackMessageAttachment.m index 05d4f3ac..8696dace 100644 --- a/Classes/BITFeedbackMessageAttachment.m +++ b/Classes/BITFeedbackMessageAttachment.m @@ -209,6 +209,13 @@ - (UIImage *)thumbnailWithSize:(CGSize)size { #pragma mark - Persistence Helpers +- (void)setFilename:(NSString *)filename { + if (filename) { + filename = [_cachePath stringByAppendingPathComponent:[filename lastPathComponent]]; + } + _filename = filename; +} + - (NSString *)possibleFilename { if (_tempFilename) { return _tempFilename; From 29aa461c0b7c1baadb6aa19fb92b0e2623e0d29d Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 15 Jun 2017 18:37:18 +0300 Subject: [PATCH 13/25] Send batch when application did enter background --- Classes/BITChannel.m | 48 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/Classes/BITChannel.m b/Classes/BITChannel.m index 4d6db473..d7f69a6c 100644 --- a/Classes/BITChannel.m +++ b/Classes/BITChannel.m @@ -27,7 +27,9 @@ NS_ASSUME_NONNULL_BEGIN -@implementation BITChannel +@implementation BITChannel { + id _appDidEnterBackgroundObserver; +} @synthesize persistence = _persistence; @synthesize channelBlocked = _channelBlocked; @@ -47,6 +49,8 @@ - (instancetype)init { } dispatch_queue_t serialQueue = dispatch_queue_create(BITDataItemsOperationsQueue, DISPATCH_QUEUE_SERIAL); _dataItemsOperations = serialQueue; + + [self registerObservers]; } return self; } @@ -59,6 +63,48 @@ - (instancetype)initWithTelemetryContext:(BITTelemetryContext *)telemetryContext return self; } +- (void)dealloc { + [self unregisterObservers]; + [self invalidateTimer]; +} + +#pragma mark - Observers + +- (void) registerObservers { + __weak typeof(self) weakSelf = self; + if(nil == _appDidEnterBackgroundObserver) { + void (^notificationBlock)(NSNotification *note) = ^(NSNotification *note) { + typeof(self) strongSelf = weakSelf; + if ([strongSelf timerIsRunning]) { + [strongSelf persistDataItemQueue]; + + /** + * From the documentation for applicationDidEnterBackground: + * It's likely any background tasks you start in applicationDidEnterBackground: will not run until after that method exits, + * you should request additional background execution time before starting those tasks. In other words, + * first call beginBackgroundTaskWithExpirationHandler: and then run the task on a dispatch queue or secondary thread. + */ + UIApplication *sharedApplication = [UIApplication sharedApplication]; + __block UIBackgroundTaskIdentifier _backgroundTask = [sharedApplication beginBackgroundTaskWithExpirationHandler:^{ + [sharedApplication endBackgroundTask:_backgroundTask]; + _backgroundTask = UIBackgroundTaskInvalid; + }]; + } + }; + _appDidEnterBackgroundObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification + object:nil + queue:NSOperationQueue.mainQueue + usingBlock:notificationBlock]; + } +} + +- (void) unregisterObservers { + if(_appDidEnterBackgroundObserver) { + [[NSNotificationCenter defaultCenter] removeObserver:_appDidEnterBackgroundObserver]; + _appDidEnterBackgroundObserver = nil; + } +} + #pragma mark - Queue management - (BOOL)isQueueBusy { From 84b96d204e95cec04e15bab3a58c236cf3a41c19 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 15 Jun 2017 23:21:44 +0300 Subject: [PATCH 14/25] Fix unit test --- Support/HockeySDKTests/BITMetricsManagerTests.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Support/HockeySDKTests/BITMetricsManagerTests.m b/Support/HockeySDKTests/BITMetricsManagerTests.m index 7ebfb764..8db7dbbe 100644 --- a/Support/HockeySDKTests/BITMetricsManagerTests.m +++ b/Support/HockeySDKTests/BITMetricsManagerTests.m @@ -78,7 +78,8 @@ - (void)testRegisterObserversOnStart { self.sut = [BITMetricsManager new]; [self.sut startManager]; - [verify((id)self.mockNotificationCenter) addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; + // 1 for BITMetricsManager + 1 for BITChannel + [verifyCount((id)self.mockNotificationCenter, times(2)) addObserverForName:UIApplicationDidEnterBackgroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; [verify((id)self.mockNotificationCenter) addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:(id)anything()]; } From 69f07e4f9de704bd6210cb6bc8280a6faf115e2f Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Thu, 15 Jun 2017 13:29:17 -0700 Subject: [PATCH 15/25] Quick fix of translation as suggested by Vinicius Depizzol --- Resources/it.lproj/HockeySDK.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/it.lproj/HockeySDK.strings b/Resources/it.lproj/HockeySDK.strings index 11db7c95..6dc3e30a 100644 --- a/Resources/it.lproj/HockeySDK.strings +++ b/Resources/it.lproj/HockeySDK.strings @@ -11,7 +11,7 @@ "HockeyYes" = "Sì"; /* For dialogs no buttons */ -"HockeyNo" = "Non inviare"; +"HockeyNo" = "No"; /* For dialogs ok buttons */ "HockeyOK" = "OK"; From 45e7b9f5d26d8c29b9fc3312140747074b130c08 Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Mon, 19 Jun 2017 14:49:53 +0300 Subject: [PATCH 16/25] Fix unstable unit test --- Support/HockeySDKTests/BITStoreUpdateManagerTests.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m index c196846d..7e43b383 100644 --- a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m +++ b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m @@ -203,6 +203,7 @@ - (void)testProcessStoreResponseWithKnownBundleIdentifier { - (void)testFirstStartHasNewVersionReturnsFalseWithFirstCheck { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; _storeUpdateManager.userDefaults = mockUserDefaults; [self startManager]; @@ -216,6 +217,7 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithFirstCheck { - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersion { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.2"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -232,6 +234,7 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersion { - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersionButDifferentUUID { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.2"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@"1"]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -247,6 +250,7 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersionButDifferentUUID { - (void)testFirstStartHasNewVersionReturnsTrue { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -263,6 +267,7 @@ - (void)testFirstStartHasNewVersionReturnsTrue { - (void)testFirstStartHasNewVersionReturnsFalseBecauseWeHaveANewerVersionInstalled { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.3"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -278,6 +283,7 @@ - (void)testFirstStartHasNewVersionReturnsFalseBecauseWeHaveANewerVersionInstall - (void)testReportedVersionIsBeingIgnored { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateIgnoredVersion"]) willReturn:@"4.1.2"]; @@ -294,6 +300,7 @@ - (void)testReportedVersionIsBeingIgnored { - (void)testReportedVersionIsNewerThanTheIgnoredVersion { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); + [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateIgnoredVersion"]) willReturn:@"4.1.1"]; From c7c86c5c3c752db155a4445aee9243511d74783e Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Mon, 19 Jun 2017 15:45:46 +0300 Subject: [PATCH 17/25] Workaround Travis tests --- .travis.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35ffb926..9d317c0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,12 @@ env: matrix: - SCHEME="HockeySDK" DESTINATION="OS=8.1,name=iPad Air" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=8.2,name=iPhone 6 Plus" RUN_TESTS="YES" - - SCHEME="HockeySDK" DESTINATION="OS=8.3,name=iPad 2" RUN_TESTS="YES" + - SCHEME="HockeySDK" DESTINATION="OS=8.3,name=iPad 2" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=8.4,name=iPhone 4s" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.0,name=iPad Air" RUN_TESTS="YES" - SCHEME="HockeySDK" DESTINATION="OS=9.1,name=iPhone 6 Plus" RUN_TESTS="YES" - - SCHEME="HockeySDK" DESTINATION="OS=10.2,name=iPad Pro (9.7-inch)" RUN_TESTS="YES" - - SCHEME="HockeySDK" DESTINATION="OS=10.3.1,name=iPhone 6s" RUN_TESTS="YES" + - SCHEME="HockeySDK" DESTINATION="OS=10.2,name=iPad Pro (9.7-inch)" RUN_TESTS="YES" + - SCHEME="HockeySDK" DESTINATION="OS=10.3.1,name=iPhone 6s" RUN_TESTS="YES" - SCHEME="HockeySDK Framework" DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 6" RUN_TESTS="YES" - SCHEME="HockeySDK Distribution" RUN_TESTS="NO" LINT="YES" @@ -31,16 +31,17 @@ script: - set -o pipefail - COMMAND="env NSUnbufferedIO=YES xcodebuild -project '$PROJECT' -scheme '$SCHEME' -sdk '$SDK' -configuration '$CONFIGURATION'" + # Add xcpretty + - COMMAND_SUFFIX=" | tee xcodebuild.log | xcpretty -f `xcpretty-travis-formatter`" + # Run tests - if [ $RUN_TESTS == "YES" ]; then - COMMAND+=" -destination '$DESTINATION' XCODEBUILD_GCC_PREPROCESSOR_DEFINITIONS="CI=1" clean test"; + COMMAND+=" -destination '$DESTINATION' XCODEBUILD_GCC_PREPROCESSOR_DEFINITIONS=\"CI=1\" " + COMMAND="$COMMAND clean build-for-testing $COMMAND_SUFFIX && $COMMAND test-without-building $COMMAND_SUFFIX"; + else + COMMAND+="$COMMAND_SUFFIX"; fi - - COMMAND+=" | tee xcodebuild.log" - - # Add xcpretty - - COMMAND+=" | xcpretty -f `xcpretty-travis-formatter`" - - echo $COMMAND - eval $COMMAND && rm xcodebuild.log - if [ $LINT == "YES" ]; then From ccf393f6fa4a062cea42bd593c0c20e4783d4ffe Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Mon, 19 Jun 2017 17:41:21 +0300 Subject: [PATCH 18/25] Use travis_retry to sure that tests really fails --- .travis.yml | 2 +- Support/HockeySDKTests/BITStoreUpdateManagerTests.m | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d317c0d..5470e29f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ script: # Run tests - if [ $RUN_TESTS == "YES" ]; then COMMAND+=" -destination '$DESTINATION' XCODEBUILD_GCC_PREPROCESSOR_DEFINITIONS=\"CI=1\" " - COMMAND="$COMMAND clean build-for-testing $COMMAND_SUFFIX && $COMMAND test-without-building $COMMAND_SUFFIX"; + COMMAND="$COMMAND clean build-for-testing $COMMAND_SUFFIX && travis_retry $COMMAND test-without-building $COMMAND_SUFFIX"; else COMMAND+="$COMMAND_SUFFIX"; fi diff --git a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m index 7e43b383..c196846d 100644 --- a/Support/HockeySDKTests/BITStoreUpdateManagerTests.m +++ b/Support/HockeySDKTests/BITStoreUpdateManagerTests.m @@ -203,7 +203,6 @@ - (void)testProcessStoreResponseWithKnownBundleIdentifier { - (void)testFirstStartHasNewVersionReturnsFalseWithFirstCheck { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; _storeUpdateManager.userDefaults = mockUserDefaults; [self startManager]; @@ -217,7 +216,6 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithFirstCheck { - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersion { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.2"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -234,7 +232,6 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersion { - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersionButDifferentUUID { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.2"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@"1"]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -250,7 +247,6 @@ - (void)testFirstStartHasNewVersionReturnsFalseWithSameVersionButDifferentUUID { - (void)testFirstStartHasNewVersionReturnsTrue { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -267,7 +263,6 @@ - (void)testFirstStartHasNewVersionReturnsTrue { - (void)testFirstStartHasNewVersionReturnsFalseBecauseWeHaveANewerVersionInstalled { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.3"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; _storeUpdateManager.userDefaults = mockUserDefaults; @@ -283,7 +278,6 @@ - (void)testFirstStartHasNewVersionReturnsFalseBecauseWeHaveANewerVersionInstall - (void)testReportedVersionIsBeingIgnored { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateIgnoredVersion"]) willReturn:@"4.1.2"]; @@ -300,7 +294,6 @@ - (void)testReportedVersionIsBeingIgnored { - (void)testReportedVersionIsNewerThanTheIgnoredVersion { NSUserDefaults *mockUserDefaults = mock([NSUserDefaults class]); - [given([mockUserDefaults objectForKey:anything()]) willReturn:nil]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastStoreVersion"]) willReturn:@"4.1.1"]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateLastUUID"]) willReturn:@""]; [given([mockUserDefaults objectForKey:@"BITStoreUpdateIgnoredVersion"]) willReturn:@"4.1.1"]; From aa19fd6ff581cdef0cee49c32db2bfc11b14e8d4 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 21 Jun 2017 16:43:17 -0700 Subject: [PATCH 19/25] Add accessibility traits to feedback UI --- Classes/BITFeedbackListViewController.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 25bcb757..b13e14a1 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -517,6 +517,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.textLabel.textAlignment = NSTextAlignmentCenter; } + cell.textLabel.accessibilityTraits = UIAccessibilityTraitStaticText; cell.textLabel.text = [NSString stringWithFormat:BITHockeyLocalizedString(@"HockeyFeedbackListLastUpdated"), [self.manager lastCheck] ? [self.lastUpdateDateFormatter stringFromDate:[self.manager lastCheck]] : BITHockeyLocalizedString(@"HockeyFeedbackListNeverUpdated")]; @@ -545,6 +546,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.selectionStyle = UITableViewCellSelectionStyleGray; } + // Set accessibilityTraits to UIAccessibilityTraitNone to make sure we're not setting the trait to an incorrect type for recycled cells. + cell.textLabel.accessibilityTraits = UIAccessibilityTraitNone; + // button NSString *titleString = nil; @@ -554,6 +558,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } if (indexPath.section == 0) { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitButton; if ([self.manager numberOfMessages] == 0) { titleString = BITHockeyLocalizedString(@"HockeyFeedbackListButtonWriteFeedback"); } else { @@ -563,17 +568,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N if ([self.manager requireUserName] == BITFeedbackUserDataElementRequired || ([self.manager requireUserName] == BITFeedbackUserDataElementOptional && [self.manager userName] != nil) ) { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitStaticText; titleString = [NSString stringWithFormat:BITHockeyLocalizedString(@"HockeyFeedbackListButtonUserDataWithName"), [self.manager userName] ?: @"-"]; } else if ([self.manager requireUserEmail] == BITFeedbackUserDataElementRequired || ([self.manager requireUserEmail] == BITFeedbackUserDataElementOptional && [self.manager userEmail] != nil) ) { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitStaticText; titleString = [NSString stringWithFormat:BITHockeyLocalizedString(@"HockeyFeedbackListButtonUserDataWithEmail"), [self.manager userEmail] ?: @"-"]; } else if ([self.manager requireUserName] == BITFeedbackUserDataElementOptional) { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitButton; titleString = BITHockeyLocalizedString(@"HockeyFeedbackListButtonUserDataSetName"); } else { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitButton; titleString = BITHockeyLocalizedString(@"HockeyFeedbackListButtonUserDataSetEmail"); } } else { + cell.textLabel.accessibilityTraits = UIAccessibilityTraitButton; titleString = BITHockeyLocalizedString(@"HockeyFeedbackListButtonDeleteAllMessages"); titleColor = BIT_RGBCOLOR(251, 35, 35); } From f22da601928ace6f27592a001f344ba5260e9aeb Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 21 Jun 2017 18:13:36 -0700 Subject: [PATCH 20/25] Bump versions 4.1.5->4.1.6 --- HockeySDK-Source.podspec | 4 +- HockeySDK.podspec | 2 +- README.md | 681 +-------------------------------- Support/HockeySDKBase.xcconfig | 4 +- 4 files changed, 22 insertions(+), 669 deletions(-) diff --git a/HockeySDK-Source.podspec b/HockeySDK-Source.podspec index a2df00de..a4a34e0f 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.5' + s.version = '4.1.6' 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="@\\"100\\"" BITHOCKEY_C_BUILD="\\"100\\""} } + s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"101\\"" BITHOCKEY_C_BUILD="\\"101\\""} } 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 92a0ec46..3cf9aa99 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'HockeySDK' - s.version = '4.1.5' + s.version = '4.1.6' 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 a0424b00..70dd7e39 100644 --- a/README.md +++ b/README.md @@ -1,703 +1,56 @@ [![Build Status](https://travis-ci.org/bitstadium/HockeySDK-iOS.svg?branch=master)](https://travis-ci.org/bitstadium/HockeySDK-iOS) [![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) +[![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) -## Version 4.1.5 - -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.5/docs/docs/Changelog.html) - -**NOTE** If your are using the binary integration of our SDK, make sure that the `HockeySDKResources.bundle` inside the `HockeySDK.embeddedframework`-folder has been added to your application. - -### Feedback and iOS 10 -**4.1.1 and later of the HockeySDK remove the Feedback feature from the default version of the SDK.** -The reason for this is that iOS 10 requires developers to add a usage string to their Info.plist in case they include the photos framework in their app. If this string is missing, the app will be rejected when submitting the app to the app store. As HockeyApp's Feedback feature includes a dependency to the photos framework. This means that if you include HockeyApp into your app, adding the usage string would be a requirement even for developers who don't use the Feedback feature. If you don't use Feedback in your app, simply upgrade HockeySDK to version 4.1.1 or newer. If you are using Feedback, please have a look at the [Feedback section](#feedback). - - -We **strongly** suggest upgrading to version 4.1.1 or a later version of the SDK. Not specifying the usage description string and using previous versions of the HockeySDK-iOS will cause the app to crash at runtime as soon as the user taps the "attach image"-button or in case you have enabled `BITFeedbackObservationModeOnScreenshot`. - -If you are using an older version of the SDK, you must add a `NSPhotoLibraryUsageDescription` to your `Info.plist` to avoid a AppStore rejection during upload of your app (please have a look at the [Feedback section](#feedback)). - -## Introduction +## Version 4.1.6 HockeySDK-iOS implements support for using HockeyApp in your iOS applications. 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, they are asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. +1. **Crash Reporting:** 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, they are 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.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. +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 them see the release notes, the version history and start the installation process right away. -4. **Update notification for app store:** The app will check if a new version for your app store release is available. If yes, it will show an alert view to the user and let him open your app in the App Store app. (Disabled by default!) +4. **Update notification for app store:** The app will check if a new version for your app store release is available. If yes, it will show an alert view to the user and let them open your app in the App Store app. (Disabled by default!) 5. **Feedback:** Collect feedback from your users from within your app and communicate directly with them using the HockeyApp backend. 6. **Authenticate:** Identify and authenticate users of Ad-Hoc or Enterprise builds -This document contains the following sections: - -1. [Requirements](#requirements) -2. [Setup](#setup) -3. [Advanced Setup](#advancedsetup) - 1. [Linking System Frameworks manually](#linkmanually) - 2. [CocoaPods](#cocoapods) - 3. [Carthage](#carthage) - 4. [iOS Extensions](#extensions) - 5. [WatchKit 1 Extensions](#watchkit) - 6. [Crash Reporting](#crashreporting) - 7. [User Metrics](#user-metrics) - 8. [Feedback](#feedback) - 9. [Store Updates](#storeupdates) - 10. [In-App-Updates (Beta & Enterprise only)](#betaupdates) - 11. [Debug information](#debug) -4. [Documentation](#documentation) -5. [Troubleshooting](#troubleshooting) -6. [Contributing](#contributing) - 1. [Code of Conduct](#codeofconduct) - 2. [Contributor License](#contributorlicense) -7. [Contact](#contact) - - -## 1. Requirements - -1. We assume that you already have a project in Xcode and that this project is opened in Xcode 7 or later. -2. The SDK supports iOS 7.0 and later. - - ## 2. Setup -We recommend integration of our binary into your Xcode project to setup HockeySDK for your iOS app. You can also use our interactive SDK integration wizard in HockeyApp for Mac which covers all the steps from below. For other ways to setup the SDK, see [Advanced Setup](#advancedsetup). - -### 2.1 Obtain an App Identifier - -Please see the "[How to create a new app](http://support.hockeyapp.net/kb/about-general-faq/how-to-create-a-new-app)" tutorial. This will provide you with an HockeyApp specific App Identifier to be used to initialize the SDK. - -### 2.2 Download the SDK - -1. Download the latest [HockeySDK-iOS](http://www.hockeyapp.net/releases/) framework which is provided as a zip-File. -2. Unzip the file and you will see a folder called `HockeySDK-iOS`. (Make sure not to use 3rd party unzip tools!) - -### 2.3 Copy the SDK into your projects directory in Finder - -From our experience, 3rd-party libraries usually reside inside a subdirectory (let's call our subdirectory `Vendor`), so if you don't have your project organized with a subdirectory for libraries, now would be a great start for it. To continue our example, create a folder called `Vendor` inside your project directory and move the unzipped `HockeySDK-iOS`-folder into it. - -The SDK comes in four flavours: - - * Default SDK without Feedback: `HockeySDK.embeddedframework` - * Full featured SDK with Feedback: `HockeySDK.embeddedframework` in the subfolder `HockeySDKAllFeatures`. - * Crash reporting only: `HockeySDK.framework` in the subfolder `HockeySDKCrashOnly`. - * Crash reporting only for extensions: `HockeySDK.framework` in the subfolder `HockeySDKCrashOnlyExtension` (which is required to be used for extensions). - -Our examples will use the **default** SDK (`HockeySDK.embeddedframework`). - - - -### 2.4 Add the SDK to the project in Xcode - -> We recommend to use Xcode's group-feature to create a group for 3rd-party-libraries similar to the structure of our files on disk. For example, similar to the file structure in 2.3 above, our projects have a group called `Vendor`. - -1. Make sure the `Project Navigator` is visible (⌘+1). -2. Drag & drop `HockeySDK.embeddedframework` from your `Finder` to the `Vendor` group in `Xcode` using the `Project Navigator` on the left side. -3. An overlay will appear. Select `Create groups` and set the checkmark for your target. Then click `Finish`. - - -### 2.5 Modify Code - -**Objective-C** - -1. Open your `AppDelegate.m` file. -2. Add the following line at the top of the file below your own `import` statements: - - ```objectivec - @import HockeySDK; - ``` - -3. Search for the method `application:didFinishLaunchingWithOptions:` -4. Add the following lines to setup and start the HockeyApp SDK: - - ```objectivec - [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - // Do some additional configuration if needed here - [[BITHockeyManager sharedHockeyManager] startManager]; - [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; // This line is obsolete in the crash only builds - ``` - -**Swift 2.3** - -1. Open your `AppDelegate.swift` file. -2. Add the following line at the top of the file below your own import statements: - - ```swift - import HockeySDK - ``` - -3. Search for the method - - ```swift - application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:[NSObject: AnyObject]?) -> Bool - ``` - -4. Add the following lines to setup and start the HockeyApp SDK: - - ```swift - BITHockeyManager.sharedHockeyManager().configureWithIdentifier("APP_IDENTIFIER") - BITHockeyManager.sharedHockeyManager().startManager() - BITHockeyManager.sharedHockeyManager().authenticator.authenticateInstallation() // This line is obsolete in the crash only builds - ``` - -**Swift 3** - -1. Open your `AppDelegate.swift` file. -2. Add the following line at the top of the file below your own import statements: - - ```swift - import HockeySDK - ``` - -3. Search for the method - - ```swift - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool - ``` - -4. Add the following lines to setup and start the HockeyApp SDK: - - ```swift - BITHockeyManager.shared().configure(withIdentifier: "APP_IDENTIFIER") - BITHockeyManager.shared().start() - BITHockeyManager.shared().authenticator.authenticateInstallation() // This line is obsolete in the crash only builds - - ``` - - -*Note:* The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that `applicationDidFinishLaunching` will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process. - - -**Congratulation, now you're all set to use HockeySDK!** - - -## 3. Advanced Setup - - -### 3.1 Linking System Frameworks manually - -If you are working with an older project which doesn't support clang modules yet or you for some reason turned off the `Enable Modules (C and Objective-C` and `Link Frameworks Automatically` options in Xcode, you have to manually link some system frameworks: - -1. Select your project in the `Project Navigator` (⌘+1). -2. Select your app target. -3. Select the tab `Build Phases`. -4. Expand `Link Binary With Libraries`. -5. Add the following system frameworks, if they are missing: - 1. Default SDK: - + `AssetsLibrary` - + `CoreText` - + `CoreGraphics` - + `Foundation` - + `MobileCoreServices` - + `QuartzCore` - + `QuickLook` - + `Security` - + `SystemConfiguration` - + `UIKit` - + `libc++` - + `libz` - 2. SDK with all features: - + `AssetsLibrary` - + `CoreText` - + `CoreGraphics` - + `Foundation` - + `MobileCoreServices` - + `QuartzCore` - + `QuickLook` - + `Photos` - + `Security` - + `SystemConfiguration` - + `UIKit` - + `libc++` - + `libz` - 3. Crash reporting only: - + `Foundation` - + `Security` - + `SystemConfiguration` - + `UIKit` - + `libc++` - 4. Crash reporting only for extensions: - + `Foundation` - + `Security` - + `SystemConfiguration` - + `libc++` - -Note that this also means that you can't use the `@import` syntax mentioned in the [Modify Code](#modify) section but have to stick to the old `#import `. - - -### 3.2 CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like HockeySDK in your projects. To learn how to setup CocoaPods for your project, visit the [official CocoaPods website](http://cocoapods.org/). - -**Podfile** - -```ruby -platform :ios, '8.0' -pod "HockeySDK" -``` - -#### 3.2.1 Binary Distribution Options - -The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK Features. - -```ruby -platform :ios, '8.0' -pod "HockeySDK" -``` - -Will integrate the *default* configuration of the SDK, with all features except the Feedback feature. - -For the SDK with all features, including Feedback, add - -```ruby -pod "HockeySDK", :subspecs => ['AllFeaturesLib'] -``` -to your podfile. - -To add the variant that only includes crash reporting, use - -```ruby -pod "HockeySDK", :subspecs => ['CrashOnlyLib'] -``` - -Or you can use the Crash Reporting build only for extensions by using the following line in your `Podfile`: - -```ruby -pod "HockeySDK", :subspecs => ['CrashOnlyExtensionsLib'] -``` - -#### 3.2.2 Source Integration Options - -Alternatively you can integrate the SDK by source if you want to do modifications or want a different feature set. The following entry will integrate the SDK: - -```ruby -pod "HockeySDK-Source" -``` - - -### 3.3 Carthage - -[Carthage](https://github.com/Carthage/Carthage) is an alternative way to add frameworks to your app. For general information about how to use Carthage, please follow their [documentation](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application). - -To add HockeySDK to your project, simply put this line into your `Cartfile`: - -`github "bitstadium/HockeySDK-iOS"` - -and then follow the steps described in the [Carthage documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos). - -This will integrate the **full-featured SDK** so you must include the `NSPhotoLibraryUsageDescription` and read the [feedback section](#feedback). If you want to include any other version of the SDK, version 4.1.4 added the ability to do that. You need to specify the configuration that you want to use - -#### Version without Feedback - -`carthage build --platform iOS --configuration ReleaseDefault HockeySDK-iOS` - -#### Crash-only Version - -`carthage build --platform iOS --configuration ReleaseCrashOnly HockeySDK-iOS` - -### Crash-only extension - -`carthage build --platform iOS --configuration ReleaseCrashOnlyExtension HockeySDK-iOS` - - -### 3.4 iOS Extensions - -The following points need to be considered to use the HockeySDK SDK with iOS Extensions: - -1. Each extension is required to use the same values for version (`CFBundleShortVersionString`) and build number (`CFBundleVersion`) as the main app uses. (This is required only if you are using the same `APP_IDENTIFIER` for your app and extensions). -2. You need to make sure the SDK setup code is only invoked **once**. Since there is no `applicationDidFinishLaunching:` equivalent and `viewDidLoad` can run multiple times, you need to use a setup like the following example: - - ```objectivec - static BOOL didSetupHockeySDK = NO; - - @interface TodayViewController () - - @end - - @implementation TodayViewController - - + (void)viewDidLoad { - [super viewDidLoad]; - if (!didSetupHockeySDK) { - [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - [[BITHockeyManager sharedHockeyManager] startManager]; - didSetupHockeySDK = YES; - } - } - ``` - -3. The binary distribution provides a special framework build in the `HockeySDKCrashOnly` or `HockeySDKCrashOnlyExtension` folder of the distribution zip file, which only contains crash reporting functionality (also automatic sending crash reports only). - - -### 3.5 WatchKit 1 Extensions - -The following points need to be considered to use HockeySDK with WatchKit 1 Extensions: - -1. WatchKit extensions don't use regular `UIViewControllers` but rather `WKInterfaceController` subclasses. These have a different lifecycle than you might be used to. - - To make sure that the HockeySDK is only instantiated once in the WatchKit extension's lifecycle we recommend using a helper class similar to this: - - ```objectivec - @import Foundation; - - @interface BITWatchSDKSetup : NSObject - - * (void)setupHockeySDKIfNeeded; - - @end - ``` - - ```objectivec - #import "BITWatchSDKSetup.h" - @import HockeySDK - - static BOOL hockeySDKIsSetup = NO; - - @implementation BITWatchSDKSetup - - * (void)setupHockeySDKIfNeeded { - if (!hockeySDKIsSetup) { - [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - [[BITHockeyManager sharedHockeyManager] startManager]; - hockeySDKIsSetup = YES; - } - } - - @end - ``` - - Then, in each of your WKInterfaceControllers where you want to use the HockeySDK, you should do this: - - ```objectivec - #import "InterfaceController.h" - @import HockeySDK - #import "BITWatchSDKSetup.h" - - @implementation InterfaceController - - + (void)awakeWithContext:(id)context { - [super awakeWithContext:context]; - [BITWatchSDKSetup setupHockeySDKIfNeeded]; - } - - + (void)willActivate { - [super willActivate]; - } - - + (void)didDeactivate { - [super didDeactivate]; - } - - @end - ``` - -2. The binary distribution provides a special framework build in the `HockeySDKCrashOnly` or `HockeySDKCrashOnlyExtension` folder of the distribution zip file, which only contains crash reporting functionality (also automatic sending crash reports only). - - -### 3.6 Crash Reporting - -The following options only show some of possibilities to interact and fine-tune the crash reporting feature. For more please check the full documentation of the `BITCrashManager` class in our [documentation](#documentation). - -#### 3.6.1 Disable Crash Reporting -The HockeySDK enables crash reporting **per default**. Crashes will be immediately sent to the server the next time the app is launched. - -To provide you with the best crash reporting, we are using a build of [PLCrashReporter]("https://github.com/plausiblelabs/plcrashreporter") based on [Version 1.2.1 / Commit 356901d7f3ca3d46fbc8640f469304e2b755e461]("https://github.com/plausiblelabs/plcrashreporter/commit/356901d7f3ca3d46fbc8640f469304e2b755e461"). - -This feature can be disabled as follows: - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager] setDisableCrashManager: YES]; //disable crash reporting - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - -#### 3.6.2 Autosend crash reports - -Crashes are send the next time the app starts. If `crashManagerStatus` is set to `BITCrashManagerStatusAutoSend`, crashes will be send without any user interaction, otherwise an alert will appear allowing the users to decide whether they want to send the report or not. - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager].crashManager setCrashManagerStatus: BITCrashManagerStatusAutoSend]; - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - -The SDK is not sending the reports right when the crash happens deliberately, because if is not safe to implement such a mechanism while being async-safe (any Objective-C code is _NOT_ async-safe!) and not causing more danger like a deadlock of the device, than helping. We found that users do start the app again because most don't know what happened, and you will get by far most of the reports. - -Sending the reports on startup is done asynchronously (non-blocking). This is the only safe way to ensure that the app won't be possibly killed by the iOS watchdog process, because startup could take too long and the app could not react to any user input when network conditions are bad or connectivity might be very slow. - -#### 3.6.3 Mach Exception Handling - -By default the SDK is using the safe and proven in-process BSD Signals for catching crashes. This option provides an option to enable catching fatal signals via a Mach exception server instead. - -We strongly advice _NOT_ to enable Mach exception handler in release versions of your apps! - -*Warning:* The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to suspend all active threads (which will include the Mach exception handler). Mach-based handling should _NOT_ be used when a debugger is attached. The SDK will not enabled catching exceptions if the app is started with the debugger running. If you attach the debugger during runtime, this may cause issues the Mach exception handler is enabled! - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager].crashManager setEnableMachExceptionHandler: YES]; - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - -#### 3.6.4 Attach additional data - -The `BITHockeyManagerDelegate` protocol provides methods to add additional data to a crash report: - -1. UserID: `- (NSString *)userIDForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager;` -2. UserName: `- (NSString *)userNameForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager;` -3. UserEmail: `- (NSString *)userEmailForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager;` - -The `BITCrashManagerDelegate` protocol (which is automatically included in `BITHockeyManagerDelegate`) provides methods to add more crash specific data to a crash report: - -1. Text attachments: `-(NSString *)applicationLogForCrashManager:(BITCrashManager *)crashManager` - - Check the following tutorial for an example on how to add CocoaLumberjack log data: [How to Add Application Specific Log Data on iOS or OS X](http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/how-to-add-application-specific-log-data-on-ios-or-os-x) -2. Binary attachments: `-(BITHockeyAttachment *)attachmentForCrashManager:(BITCrashManager *)crashManager` - -Make sure to implement the protocol - -```objectivec -@interface YourAppDelegate () {} - -@end -``` - -and set the delegate: - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager] setDelegate: self]; - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - - - -### 3.7 User Metrics - -HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom. - -- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. -- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. -- **Custom Events**: With HockeySDK 4.1.0 you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. -- **Batching & offline behavior**: The SDK batches up to 50 events or waits for 15s and then persist and send the events, whichever comes first. So for sessions, this might actually mean we send 1 single event per batch. If you are sending Custom Events, it can be 1 session event plus X of your Custom Events (up to 50 events per batch total). In case the device is offline, up to 300 events are stored until the SDK starts to drop new events. - -Just in case you want to opt-out of the automatic collection of anonymous users and sessions statistics, there is a way to turn this functionality off at any time: - -```objectivec -[BITHockeyManager sharedHockeyManager].disableMetricsManager = YES; -``` - -#### 3.7.1 Custom Events - -By tracking custom events, you can now get insight into how your customers use your app, understand their behavior and answer important business or user experience questions while improving your app. - -- Before starting to track events, ask yourself the questions that you want to get answers to. For instance, you might be interested in business, performance/quality or user experience aspects. -- Name your events in a meaningful way and keep in mind that you will use these names when searching for events in the HockeyApp web portal. It is your reponsibility to not collect personal information as part of the events tracking. - -**Objective-C** - -```objectivec -BITMetricsManager *metricsManager = [BITHockeyManager sharedHockeyManager].metricsManager; - -[metricsManager trackEventWithName:eventName] -``` - -**Swift** - -```swift -let metricsManager = BITHockeyManager.sharedHockeyManager().metricsManager - -metricsManager.trackEventWithName(eventName) -``` - -**Limitations** - -- Accepted characters for tracking events are: [a-zA-Z0-9_. -]. If you use other than the accepted characters, your events will not show up in the HockeyApp web portal. -- 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 properties and/or measurements to a custom event. There is one limitation to attaching properties and measurements. They currently don't show up in the HockeyApp dashboard but you have to link your app to Application Insights to be able to query them. Please have a look at [our blogpost](https://www.hockeyapp.net/blog/2016/08/30/custom-events-public-preview.html) to find out how to do that. - -- 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 - -As of HockeySDK 4.1.1, Feedback is no longer part of the default SDK. To use feedback in your app, integrate the SDK with all features as follows: - -#### 3.8.1 Integrate the full-featured SDK. - -If you're integrating the binary yourself, use the `HockeySDK.embeddedframework` in the subfolder `HockeySDKAllFeatures`. If you're using cocoapods, use - -```ruby -pod "HockeySDK", :subspecs => ['AllFeaturesLib'] -``` - -in your podfile. - -`BITFeedbackManager` lets your users communicate directly with you via the app and an integrated user interface. It provides a single threaded discussion with a user running your app. This feature is only enabled, if you integrate the actual view controllers into your app. - -You should never create your own instance of `BITFeedbackManager` but use the one provided by the `[BITHockeyManager sharedHockeyManager]`: - -```objectivec -[BITHockeyManager sharedHockeyManager].feedbackManager -``` - -Please check the [documentation](#documentation) of the `BITFeedbackManager` and `BITFeedbackManagerDelegate` classes on more information on how to leverage this feature. - -#### 3.8.2 Add the NSPhotoLibraryUsageDescription to your Info.plist. - -As of iOS 10, developers have to add UsageDescription-strings before using system frameworks with privacy features (read more on this in [Apple's own documentation](https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewIniOS/Articles/iOS10.html#//apple_ref/doc/uid/TP40017084-SW3)). To make allow users to attach photos to feedback, add the `NSPhotoLibraryUsageDescription` to your `Info.plist` and provide a description. Make sure to localize your description as described in [Apple's documentation about localizing Info.plist strings](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html). - -If the value is missing from your `Info.plist`, the SDK will disable attaching potos to feedback and disable the creation of a new feedback item in case of a screenshot. - - - -### 3.9 Store Updates - -This is the HockeySDK module for handling app updates when having your app released in the App Store. - -When an update is detected, this module will show an alert asking the user if he/she wants to update or ignore this version. If update was chosen, it will open the apps page in the app store app. - -By default this module is **NOT** enabled! To enable it use the following code: - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager] setEnableStoreUpdateManager: YES]; - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - -When this module is enabled and **NOT** running in an App Store build/environment, it won't do any checks! - -Please check the [documentation](#documentation) of the `BITStoreUpdateManager` class on more information on how to leverage this feature and know about its limits. - - -### 3.10 In-App-Updates (Beta & Enterprise only) - -The following options only show some of possibilities to interact and fine-tune the update feature when using Ad-Hoc or Enterprise provisioning profiles. For more please check the full documentation of the `BITUpdateManager` class in our [documentation](#documentation). - -The feature handles version updates, presents update and version information in a App Store like user interface, collects usage information and provides additional authorization options when using Ad-Hoc provisioning profiles. - -This module automatically disables itself when running in an App Store build by default! - -This feature can be disabled manually as follows: - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[[BITHockeyManager sharedHockeyManager] setDisableUpdateManager: YES]; //disable auto updating - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - -If you want to see beta analytics, use the beta distribution feature with in-app updates, restrict versions to specific users, or want to know who is actually testing your app, you need to follow the instructions on our guide [Authenticating Users on iOS](http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/authenticating-users-on-ios) - - -### 3.11 Debug information - -To check if data is send properly to HockeyApp and also see some additional SDK debug log data in the console, add the following line before `startManager`: - -```objectivec -[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"]; - -[BITHockeyManager sharedHockeyManager].logLevel = BITLogLevelDebug; - -[[BITHockeyManager sharedHockeyManager] startManager]; -``` - - -## 4. Documentation - -Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.5/index.html). - - -## 5.Troubleshooting - -### Linker warnings - - Make sure that all mentioned frameworks and libraries are linked - -### iTunes Connect rejection - - 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.5.docset` +It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation]() and onboard your app within minutes. -### Feature are not working as expected +## 3. Documentation - Enable debug output to the console to see additional information from the SDK initializing the modules, sending and receiving network requests and more by adding the following code before calling `startManager`: +Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/4.1.6/index.html) as a starting point for all of our documentation. - `[BITHockeyManager sharedHockeyManager].logLevel = BITLogLevelDebug;` +Please check out our [getting started documentation](https://www.hockeyapp.net/help/sdk/ios/4.1.5/docs/docs/Guide-Installation-Setup.html), [changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Changelog.html), [header docs](https://www.hockeyapp.net/help/sdk/ios/4.1.1/index.html) as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/4.1.5/docs/docs/Guide-Installation-Setup.html#troubleshooting). - -## 6. Contributing +## 4. Contributing We're looking forward to your contributions via pull requests. **Development environment** -* Mac running the latest version of OS X -* Get the latest Xcode from the Mac App Store +* A mac running the latest version of OS X. +* Get the latest Xcode from the Mac App Store. * [AppleDoc](https://github.com/tomaz/appledoc) * [CocoaPods](https://cocoapods.org/) * [Carthage](https://github.com/Carthage/Carthage) - -### 6.1 Code of Conduct +### 4.1 Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -### 6.2 Contributor License +### 4.2 Contributor License You must sign a [Contributor License Agreement](https://cla.microsoft.com/) before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the [form](https://cla.microsoft.com/) and then electronically sign the CLA when you receive the email containing the link to the document. You need to sign the CLA only once to cover submission to any Microsoft OSS project. - -## 7. Contact +## 5. Contact -If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net) [![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) +If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). diff --git a/Support/HockeySDKBase.xcconfig b/Support/HockeySDKBase.xcconfig index f86a60c1..34951bfb 100644 --- a/Support/HockeySDKBase.xcconfig +++ b/Support/HockeySDKBase.xcconfig @@ -1,5 +1,5 @@ -BUILD_NUMBER = 100 -VERSION_STRING = 4.1.5 +BUILD_NUMBER = 101 +VERSION_STRING = 4.1.6 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 de28b6ed29522fbee631778aad83a745d9953106 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Wed, 21 Jun 2017 18:15:03 -0700 Subject: [PATCH 21/25] Streamline the docs --- docs/Changelog-template.md | 16 +++- docs/Guide-Installation-Setup-template.md | 90 +++++++++++++++++------ 2 files changed, 82 insertions(+), 24 deletions(-) diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index a7030bdf..fa5a7075 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,9 +1,19 @@ +## 4.1.6 + +- [BUGFIX] Fixed a string in the Italian translation [#430](https://github.com/bitstadium/HockeySDK-iOS/pull/430). +- [BUGFIX] Fix bug that prevented images that were attached to Feedback from loading [#428](https://github.com/bitstadium/HockeySDK-iOS/pull/428) – thx to [Zoltan](https://github.com/Xperion-meszaroz) for the contribution. +- [IMPROVEMENT] Improved the accessibility of the Feedback UI, it now uses the proper accessibility traits. +- [IMPROVEMENT] The crash-only flavor of the SDK now doesn't contain the Metrics feature. +- [IMPROVEMENT] The SDK can be compiled using Xcode 9 [#423](https://github.com/bitstadium/HockeySDK-iOS/pull/423) – thx to [Stephan](https://github.com/diederich) and [Piet](https://github.com/pietbrauer) for the contribution! +- [IMPROVEMENT] Metrics info will be send to the backend every time the application goes from foreground to background [#429](https://github.com/bitstadium/HockeySDK-iOS/pull/429) - thx to [Ivan](https://github.com/MatkovIvan) for the contribution. +- [IMPROVEMENT] Our readme.md now uses gender-neutral language [#427](https://github.com/bitstadium/HockeySDK-iOS/pull/427). + ## 4.1.5 -This release officially dropps the support for iOS 6. +This release officially drops the support for iOS 6. -- [FIX] Remove the dependency for AssetLibrary for the default subspec in our podspec [#403](https://github.com/bitstadium/HockeySDK-iOS/pull/403). Thanks to [@tschob](https://github.com/tschob) for the pointer. -- [FIX] A couple of visual bugs have been fixed [#404](https://github.com/bitstadium/HockeySDK-iOS/pull/404) thanks to [@dweston](https://github.com/dtweston). +- [BUGFIX] Remove the dependency for AssetLibrary for the default subspec in our podspec [#403](https://github.com/bitstadium/HockeySDK-iOS/pull/403). Thanks to [@tschob](https://github.com/tschob) for the pointer. +- [BUGFIX] A couple of visual bugs have been fixed [#404](https://github.com/bitstadium/HockeySDK-iOS/pull/404) thanks to [@dweston](https://github.com/dtweston). - [IMPROVEMENT] We have improved accessibility of our feedback UI [#409](https://github.com/bitstadium/HockeySDK-iOS/pull/409) with help by [@erychagov](https://github.com/erychagov). ## 4.1.4 diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index e0370481..7217b9a9 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -2,18 +2,20 @@ [![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.1 +## Version 4.1.6 -- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.1/docs/docs/Changelog.html) +- [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Changelog.html) + +**NOTE** If your are using the binary integration of our SDK, make sure that the `HockeySDKResources.bundle` inside the `HockeySDK.embeddedframework`-folder has been added to your application. ### Feedback and iOS 10 -**4.1.1 of the HockeySDK removes the Feedback feature from the default version of the SDK.** -The reason for this is that iOS 10 requires developers to add a usage string to their Info.plist in case they include the photos framework in their app. If this string is missing, the app will be rejected when submitting the app to the app store. As HockeyApp's Feedback feature includes a dependency to the photos framework. This means that if you include HockeyApp into your app, adding the usage string would be a requirement even for developers who don't use the Feedback feature. If you don't use Feedback in your app, simply upgrade HockeySDK to version 4.1.1. If you are using Feedback, please have a look at the [Feedback section](#feedback). +**4.1.1 and later of the HockeySDK remove the Feedback feature from the default version of the SDK.** +The reason for this is that iOS 10 requires developers to add a usage string to their Info.plist in case they include the photos framework in their app. If this string is missing, the app will be rejected when submitting the app to the app store. As HockeyApp's Feedback feature includes a dependency to the photos framework. This means that if you include HockeyApp into your app, adding the usage string would be a requirement even for developers who don't use the Feedback feature. If you don't use Feedback in your app, simply upgrade HockeySDK to version 4.1.1 or newer. If you are using Feedback, please have a look at the [Feedback section](#feedback). -We **strongly** suggest upgrading to version 4.1.1 of the SDK. Not specifying the usage description string and using previous versions of the HockeySDK-iOS will cause the app to crash at runtime as soon as the user taps the "attach image"-button or in case you have enabled `BITFeedbackObservationModeOnScreenshot`. +We **strongly** suggest upgrading to version 4.1.1 or a later version of the SDK. Not specifying the usage description string and using previous versions of the HockeySDK-iOS will cause the app to crash at runtime as soon as the user taps the "attach image"-button or in case you have enabled `BITFeedbackObservationModeOnScreenshot`. -If you are using an older version of the SDK, you have to add a `NSPhotoLibraryUsageDescription` to your `Info.plist` to avoid a AppStore rejection during upload of your app (please have a look at the [Feedback section](#feedback)). +If you are using an older version of the SDK, you must add a `NSPhotoLibraryUsageDescription` to your `Info.plist` to avoid a AppStore rejection during upload of your app (please have a look at the [Feedback section](#feedback)). ## Introduction @@ -25,9 +27,9 @@ The following features are currently supported: 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. +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 them see the release notes, the version history and start the installation process right away. -4. **Update notification for app store:** The app will check if a new version for your app store release is available. If yes, it will show an alert view to the user and let him open your app in the App Store app. (Disabled by default!) +4. **Update notification for app store:** The app will check if a new version for your app store release is available. If yes, it will show an alert view to the user and let them open your app in the App Store app. (Disabled by default!) 5. **Feedback:** Collect feedback from your users from within your app and communicate directly with them using the HockeyApp backend. @@ -60,7 +62,7 @@ This document contains the following sections: ## 1. Requirements 1. We assume that you already have a project in Xcode and that this project is opened in Xcode 7 or later. -2. The SDK supports iOS 6.0 and later. +2. The SDK supports iOS 7.0 and later. ## 2. Setup @@ -82,7 +84,7 @@ From our experience, 3rd-party libraries usually reside inside a subdirectory (l The SDK comes in four flavours: - * Default SDK without Feedback `HockeySDK.embeddedframework` + * Default SDK without Feedback: `HockeySDK.embeddedframework` * Full featured SDK with Feedback: `HockeySDK.embeddedframework` in the subfolder `HockeySDKAllFeatures`. * Crash reporting only: `HockeySDK.framework` in the subfolder `HockeySDKCrashOnly`. * Crash reporting only for extensions: `HockeySDK.framework` in the subfolder `HockeySDKCrashOnlyExtension` (which is required to be used for extensions). @@ -121,7 +123,7 @@ Our examples will use the **default** SDK (`HockeySDK.embeddedframework`). [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; // This line is obsolete in the crash only builds ``` -**Swift** +**Swift 2.3** 1. Open your `AppDelegate.swift` file. 2. Add the following line at the top of the file below your own import statements: @@ -144,6 +146,31 @@ Our examples will use the **default** SDK (`HockeySDK.embeddedframework`). BITHockeyManager.sharedHockeyManager().authenticator.authenticateInstallation() // This line is obsolete in the crash only builds ``` +**Swift 3** + +1. Open your `AppDelegate.swift` file. +2. Add the following line at the top of the file below your own import statements: + + ```swift + import HockeySDK + ``` + +3. Search for the method + + ```swift + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool + ``` + +4. Add the following lines to setup and start the HockeyApp SDK: + + ```swift + BITHockeyManager.shared().configure(withIdentifier: "APP_IDENTIFIER") + BITHockeyManager.shared().start() + BITHockeyManager.shared().authenticator.authenticateInstallation() // This line is obsolete in the crash only builds + + ``` + + *Note:* The SDK is optimized to defer everything possible to a later time while making sure e.g. crashes on startup can also be caught and each module executes other code with a delay some seconds. This ensures that `applicationDidFinishLaunching` will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process. @@ -217,16 +244,22 @@ pod "HockeySDK" #### 3.2.1 Binary Distribution Options -The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK Features: Crash Reporting, User Feedback, Store Updates, Authentication, AdHoc Updates. +The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK Features. -You can alternative use a Crash Reporting build only by using the following line in your `Podfile`: +```ruby +platform :ios, '8.0' +pod "HockeySDK" +``` -For the SDK with all features, add +Will integrate the *default* configuration of the SDK, with all features except the Feedback feature. + +For the SDK with all features, including Feedback, add ```ruby pod "HockeySDK", :subspecs => ['AllFeaturesLib'] ``` to your podfile. + To add the variant that only includes crash reporting, use ```ruby @@ -241,7 +274,7 @@ pod "HockeySDK", :subspecs => ['CrashOnlyExtensionsLib'] #### 3.2.2 Source Integration Options -Alternatively you can integrate the SDK by source if you want to do any modifications or want a different feature set. The following entry will integrate the SDK: +Alternatively you can integrate the SDK by source if you want to do modifications or want a different feature set. The following entry will integrate the SDK: ```ruby pod "HockeySDK-Source" @@ -258,6 +291,20 @@ To add HockeySDK to your project, simply put this line into your `Cartfile`: and then follow the steps described in the [Carthage documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos). +This will integrate the **full-featured SDK** so you must include the `NSPhotoLibraryUsageDescription` and read the [feedback section](#feedback). If you want to include any other version of the SDK, version 4.1.4 added the ability to do that. You need to specify the configuration that you want to use + +#### Version without Feedback + +`carthage build --platform iOS --configuration ReleaseDefault HockeySDK-iOS` + +#### Crash-only Version + +`carthage build --platform iOS --configuration ReleaseCrashOnly HockeySDK-iOS` + +### Crash-only extension + +`carthage build --platform iOS --configuration ReleaseCrashOnlyExtension HockeySDK-iOS` + ### 3.4 iOS Extensions @@ -360,7 +407,7 @@ The following options only show some of possibilities to interact and fine-tune #### 3.6.1 Disable Crash Reporting The HockeySDK enables crash reporting **per default**. Crashes will be immediately sent to the server the next time the app is launched. -To provide you with the best crash reporting, we are using [PLCrashReporter]("https://github.com/plausiblelabs/plcrashreporter") in [Version 1.2 / Commit 356901d7f3ca3d46fbc8640f469304e2b755e461]("https://github.com/plausiblelabs/plcrashreporter/commit/356901d7f3ca3d46fbc8640f469304e2b755e461"). +To provide you with the best crash reporting, we are using a build of [PLCrashReporter]("https://github.com/plausiblelabs/plcrashreporter") based on [Version 1.2.1 / Commit 356901d7f3ca3d46fbc8640f469304e2b755e461]("https://github.com/plausiblelabs/plcrashreporter/commit/356901d7f3ca3d46fbc8640f469304e2b755e461"). This feature can be disabled as follows: @@ -442,9 +489,11 @@ and set the delegate: ### 3.7 User Metrics HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom. + - **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. - **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. - **Custom Events**: With HockeySDK 4.1.0 you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. +- **Batching & offline behavior**: The SDK batches up to 50 events or waits for 15s and then persist and send the events, whichever comes first. So for sessions, this might actually mean we send 1 single event per batch. If you are sending Custom Events, it can be 1 session event plus X of your Custom Events (up to 50 events per batch total). In case the device is offline, up to 300 events are stored until the SDK starts to drop new events. Just in case you want to opt-out of the automatic collection of anonymous users and sessions statistics, there is a way to turn this functionality off at any time: @@ -483,7 +532,7 @@ metricsManager.trackEventWithName(eventName) #### 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. +It's possible to attach properties and/or measurements to a custom event. There is one limitation to attaching properties and measurements. They currently don't show up in the HockeyApp dashboard but you have to link your app to Application Insights to be able to query them. Please have a look at [our blogpost](https://www.hockeyapp.net/blog/2016/08/30/custom-events-public-preview.html) to find out how to do that. - Properties have to be a string. - Measurements have to be of a numeric type. @@ -513,7 +562,6 @@ let metricsManager = BITHockeyManager.sharedHockeyManager().metricsManager metricsManager.trackEventWithName(eventName, properties: myProperties, myMeasurements: measurements) ``` - ### 3.8 Feedback @@ -537,7 +585,7 @@ You should never create your own instance of `BITFeedbackManager` but use the on [BITHockeyManager sharedHockeyManager].feedbackManager ``` -Please check the [documentation](#documentation) of the `BITFeedbackManager` class on more information on how to leverage this feature. +Please check the [documentation](#documentation) of the `BITFeedbackManager` and `BITFeedbackManagerDelegate` classes on more information on how to leverage this feature. #### 3.8.2 Add the NSPhotoLibraryUsageDescription to your Info.plist. @@ -604,7 +652,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.1/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.5/index.html). ## 5.Troubleshooting @@ -618,7 +666,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.1.docset` + - `de.bitstadium.HockeySDK-iOS-4.1.5.docset` ### Feature are not working as expected From 95d0107060bfde719abf2a4555011224bf63d5e0 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Thu, 22 Jun 2017 14:00:26 -0700 Subject: [PATCH 22/25] Version bumps and fixed typos. --- README.md | 8 ++++---- docs/Changelog-template.md | 6 +++--- docs/Guide-Installation-Setup-template.md | 18 +++++++++--------- ...wTo-Set-Custom-AlertViewHandler-template.md | 2 +- docs/HowTo-Upload-Symbols-template.md | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 70dd7e39..f7dff861 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,13 @@ It is super easy to use HockeyApp in your iOS app. Have a look at our [documenta Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/4.1.6/index.html) as a starting point for all of our documentation. -Please check out our [getting started documentation](https://www.hockeyapp.net/help/sdk/ios/4.1.5/docs/docs/Guide-Installation-Setup.html), [changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Changelog.html), [header docs](https://www.hockeyapp.net/help/sdk/ios/4.1.1/index.html) as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/4.1.5/docs/docs/Guide-Installation-Setup.html#troubleshooting). +Please check out our [getting started documentation](https://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Guide-Installation-Setup.html), [changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Changelog.html), [header docs](https://www.hockeyapp.net/help/sdk/ios/4.1.6/index.html) as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Guide-Installation-Setup.html#troubleshooting). ## 4. Contributing We're looking forward to your contributions via pull requests. -**Development environment** +### 4.1 Development environment * A mac running the latest version of OS X. * Get the latest Xcode from the Mac App Store. @@ -43,11 +43,11 @@ We're looking forward to your contributions via pull requests. * [CocoaPods](https://cocoapods.org/) * [Carthage](https://github.com/Carthage/Carthage) -### 4.1 Code of Conduct +### 4.2 Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -### 4.2 Contributor License +### 4.3 Contributor License You must sign a [Contributor License Agreement](https://cla.microsoft.com/) before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the [form](https://cla.microsoft.com/) and then electronically sign the CLA when you receive the email containing the link to the document. You need to sign the CLA only once to cover submission to any Microsoft OSS project. diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index fa5a7075..a2d05b03 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -6,7 +6,7 @@ - [IMPROVEMENT] The crash-only flavor of the SDK now doesn't contain the Metrics feature. - [IMPROVEMENT] The SDK can be compiled using Xcode 9 [#423](https://github.com/bitstadium/HockeySDK-iOS/pull/423) – thx to [Stephan](https://github.com/diederich) and [Piet](https://github.com/pietbrauer) for the contribution! - [IMPROVEMENT] Metrics info will be send to the backend every time the application goes from foreground to background [#429](https://github.com/bitstadium/HockeySDK-iOS/pull/429) - thx to [Ivan](https://github.com/MatkovIvan) for the contribution. -- [IMPROVEMENT] Our readme.md now uses gender-neutral language [#427](https://github.com/bitstadium/HockeySDK-iOS/pull/427). +- [IMPROVEMENT] Our README.md now use gender-neutral language [#427](https://github.com/bitstadium/HockeySDK-iOS/pull/427). ## 4.1.5 @@ -155,7 +155,7 @@ This SDK release explicitly includes the Application Support directory into back ## Version 3.8.6 -- [UPDATE] Some minor refactorings +- [UPDATE] Some minor refactoring - [BUGFIX] Fix crash in `BITCrashReportTextFormatter` in cases where processPath is unexpectedly nil - [BUGFIX] Fix bug where feedback image could only be added once - [BUGFIX] Fix URL encoding bug in BITUpdateManager @@ -278,7 +278,7 @@ This SDK release explicitly includes the Application Support directory into back - [NEW] `BITCrashManager`: Added launch time to crash reports - [NEW] `BITFeedbackManager`: Added support for setting tintColor for feedback list buttons -- [NEW] `BITFeedbackManager`: Added `feedbackComposerPreparedItems` to prefill feedback compose UI message with given items +- [NEW] `BITFeedbackManager`: Added `feedbackComposerPreparedItems` to pre-fill feedback compose UI message with given items - [NEW] `BITUpdateManagerDelegate`: Added `willStartDownloadAndUpdate` to be notified before beta update starts - [UPDATE] Improved CocoaPods support to allow building as a native iOS 8 framework - [UPDATE] Keychain is now accessed with `kSecAttrAccessibleAlwaysThisDeviceOnly` to support apps that are running in the background and the device is still locked diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index 7217b9a9..2a956a67 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -419,7 +419,7 @@ This feature can be disabled as follows: [[BITHockeyManager sharedHockeyManager] startManager]; ``` -#### 3.6.2 Autosend crash reports +#### 3.6.2 Auto send crash reports Crashes are send the next time the app starts. If `crashManagerStatus` is set to `BITCrashManagerStatusAutoSend`, crashes will be send without any user interaction, otherwise an alert will appear allowing the users to decide whether they want to send the report or not. @@ -490,9 +490,9 @@ and set the delegate: HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom. -- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. -- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. -- **Custom Events**: With HockeySDK 4.1.0 you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. +- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e., when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. +- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. This anonymous ID is stored in the keychain, as of iOS 10, it no longer persists across re-installations. +- **Custom Events**: With HockeySDK 4.1.0 and later, you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. - **Batching & offline behavior**: The SDK batches up to 50 events or waits for 15s and then persist and send the events, whichever comes first. So for sessions, this might actually mean we send 1 single event per batch. If you are sending Custom Events, it can be 1 session event plus X of your Custom Events (up to 50 events per batch total). In case the device is offline, up to 300 events are stored until the SDK starts to drop new events. Just in case you want to opt-out of the automatic collection of anonymous users and sessions statistics, there is a way to turn this functionality off at any time: @@ -506,7 +506,7 @@ Just in case you want to opt-out of the automatic collection of anonymous users By tracking custom events, you can now get insight into how your customers use your app, understand their behavior and answer important business or user experience questions while improving your app. - Before starting to track events, ask yourself the questions that you want to get answers to. For instance, you might be interested in business, performance/quality or user experience aspects. -- Name your events in a meaningful way and keep in mind that you will use these names when searching for events in the HockeyApp web portal. It is your reponsibility to not collect personal information as part of the events tracking. +- Name your events in a meaningful way and keep in mind that you will use these names when searching for events in the HockeyApp web portal. It is your responsibility to not collect personal information as part of the events tracking. **Objective-C** @@ -569,7 +569,7 @@ As of HockeySDK 4.1.1, Feedback is no longer part of the default SDK. To use fee #### 3.8.1 Integrate the full-featured SDK. -If you're integrating the binary yourself, use the `HockeySDK.embeddedframework` in the subfolder `HockeySDKAllFeatures`. If you're using cocoapods, use +If you're integrating the binary yourself, use the `HockeySDK.embeddedframework` in the subfolder `HockeySDKAllFeatures`. If you're using Cocoapods, use ```ruby pod "HockeySDK", :subspecs => ['AllFeaturesLib'] @@ -591,7 +591,7 @@ Please check the [documentation](#documentation) of the `BITFeedbackManager` and As of iOS 10, developers have to add UsageDescription-strings before using system frameworks with privacy features (read more on this in [Apple's own documentation](https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewIniOS/Articles/iOS10.html#//apple_ref/doc/uid/TP40017084-SW3)). To make allow users to attach photos to feedback, add the `NSPhotoLibraryUsageDescription` to your `Info.plist` and provide a description. Make sure to localize your description as described in [Apple's documentation about localizing Info.plist strings](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html). -If the value is missing from your `Info.plist`, the SDK will disable attaching potos to feedback and disable the creation of a new feedback item in case of a screenshot. +If the value is missing from your `Info.plist`, the SDK will disable attaching photos to feedback and disable the creation of a new feedback item in case of a screenshot. @@ -652,7 +652,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.5/index.html). +Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/4.1.6/index.html). ## 5.Troubleshooting @@ -666,7 +666,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.5.docset` + - `de.bitstadium.HockeySDK-iOS-4.1.6.docset` ### Feature are not working as expected diff --git a/docs/HowTo-Set-Custom-AlertViewHandler-template.md b/docs/HowTo-Set-Custom-AlertViewHandler-template.md index cf70b001..b1879f5d 100644 --- a/docs/HowTo-Set-Custom-AlertViewHandler-template.md +++ b/docs/HowTo-Set-Custom-AlertViewHandler-template.md @@ -2,7 +2,7 @@ HockeySDK lets the user decide wether to send a crash report or lets the developer send crash reports automatically without user interaction. In addition it is possible to attach more data like logs, a binary, or the users name, email or a user ID if this is already known. -Starting HockeySDK version 3.6 it is now possible to customize this even further and implement your own flow to e.g. ask the user for more details about what happened or his name and email address if your app doesn't know that yet. +Starting with HockeySDK version 3.6 it is possible to customize this even further and implement your own flow to e.g. ask the user for more details about what happened or his name and email address if your app doesn't know that yet. The following example shows how this could be implemented. We'll present a custom UIAlertView asking the user for more details and attaching that to the crash report. diff --git a/docs/HowTo-Upload-Symbols-template.md b/docs/HowTo-Upload-Symbols-template.md index 0a616b51..8b474a07 100644 --- a/docs/HowTo-Upload-Symbols-template.md +++ b/docs/HowTo-Upload-Symbols-template.md @@ -1,6 +1,6 @@ ## Introduction -Mac and iOS crash reports show the stack traces for all running threads of your app of the time a crash occured. But the stack traces only contain memory addresses and don't show class names, methods, file names and line numbers that are needed to understand them. +Mac and iOS crash reports show the stack traces for all running threads of your app of the time a crash occurred. But the stack traces only contain memory addresses and don't show class names, methods, file names and line numbers that are needed to understand them. To get these memory addresses translated you need to upload a dSYM package to the server, which contains all information required to make this happen. The symbolication process will then check the binary images section of the crash report and grab the UUID of the binary that caused the crash. Next it will get the UUID of the dSYM package to make sure they are identical and process the data if so. From e346d89248d2b900ba10f5d38cc8c6b8a0e1d7e2 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Thu, 22 Jun 2017 16:54:37 -0700 Subject: [PATCH 23/25] Updating the guide for first installation --- docs/Guide-Installation-Setup-template.md | 34 ++++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index 2a956a67..ff636a1e 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -1,7 +1,8 @@ [![Build Status](https://travis-ci.org/bitstadium/HockeySDK-iOS.svg?branch=master)](https://travis-ci.org/bitstadium/HockeySDK-iOS) [![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) - + [![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) + ## Version 4.1.6 - [Changelog](http://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Changelog.html) @@ -54,8 +55,9 @@ This document contains the following sections: 4. [Documentation](#documentation) 5. [Troubleshooting](#troubleshooting) 6. [Contributing](#contributing) - 1. [Code of Conduct](#codeofconduct) - 2. [Contributor License](#contributorlicense) + 1. [Development Environment](#developmentenvironment) + 2. [Code of Conduct](#codeofconduct) + 3. [Contributor License](#contributorlicense) 7. [Contact](#contact) @@ -297,7 +299,7 @@ This will integrate the **full-featured SDK** so you must include the `NSPhotoLi `carthage build --platform iOS --configuration ReleaseDefault HockeySDK-iOS` -#### Crash-only Version +#### Crash-only version `carthage build --platform iOS --configuration ReleaseCrashOnly HockeySDK-iOS` @@ -484,7 +486,6 @@ and set the delegate: [[BITHockeyManager sharedHockeyManager] startManager]; ``` - ### 3.7 User Metrics @@ -634,6 +635,8 @@ This feature can be disabled manually as follows: [[BITHockeyManager sharedHockeyManager] startManager]; ``` +Please note that the SDK expects your CFBundleVersion values to always increase and never reset to detect a new update. + If you want to see beta analytics, use the beta distribution feature with in-app updates, restrict versions to specific users, or want to know who is actually testing your app, you need to follow the instructions on our guide [Authenticating Users on iOS](http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/authenticating-users-on-ios) @@ -668,18 +671,29 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/ - `HockeySDK.framework` (except if you build a dynamic framework version of the SDK yourself!) - `de.bitstadium.HockeySDK-iOS-4.1.6.docset` -### Feature are not working as expected +### Features are not working as expected Enable debug output to the console to see additional information from the SDK initializing the modules, sending and receiving network requests and more by adding the following code before calling `startManager`: `[BITHockeyManager sharedHockeyManager].logLevel = BITLogLevelDebug;` +### Wrong strings or "Missing HockeySDKResources.bundle" error + +1. Please check if the `HockeySDKResources.bundle` is added to your app bundle. Use Finder to inspect your `.app` bundle to see if the bundle is added. + +2. If it is missing, please check if the resources bundle is mentioned in your app target's `Copy Bundle Resources` build step in the `Build Phases` tab. Add the resource bundle manually if necessary. + +3. Make a clean build and try again. + +![Screenshot_2015-12-22_01.07.27.png](https://support.hockeyapp.net/help/assets/0e9d2eb58de8355363b89bd491d6fcf4c14f596e/normal/Screenshot_2015-12-22_01.07.27.png) + ## 6. Contributing We're looking forward to your contributions via pull requests. -**Development environment** + +### 6.1 Development environment * Mac running the latest version of OS X * Get the latest Xcode from the Mac App Store @@ -688,16 +702,16 @@ We're looking forward to your contributions via pull requests. * [Carthage](https://github.com/Carthage/Carthage) -### 6.1 Code of Conduct +### 6.2 Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. -### 6.2 Contributor License +### 6.3 Contributor License You must sign a [Contributor License Agreement](https://cla.microsoft.com/) before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the [form](https://cla.microsoft.com/) and then electronically sign the CLA when you receive the email containing the link to the document. You need to sign the CLA only once to cover submission to any Microsoft OSS project. ## 7. Contact -If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net) [![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net) +If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). From 4a06f769a9e15821d5928b249229747a636eb7d6 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Thu, 22 Jun 2017 17:21:20 -0700 Subject: [PATCH 24/25] =?UTF-8?q?Address=20Mat=E2=80=99s=20comments=20and?= =?UTF-8?q?=20update=20README=20and=20installation=20guide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- docs/Guide-Installation-Setup-template.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f7dff861..256acfcb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ HockeySDK-iOS implements support for using HockeyApp in your iOS applications. The following features are currently supported: -1. **Crash Reporting:** 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, they are asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. +1. **Crash Reporting:** 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, they are 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. You can now track **Custom Events** in your app, understand user actions and see the aggregates on the HockeyApp portal. @@ -23,7 +23,7 @@ The following features are currently supported: ## 2. Setup -It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation]() and onboard your app within minutes. +It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation](https://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Guide-Installation-Setup.html) and onboard your app within minutes. ## 3. Documentation @@ -37,7 +37,7 @@ We're looking forward to your contributions via pull requests. ### 4.1 Development environment -* A mac running the latest version of OS X. +* A Mac running the latest version of OS X. * Get the latest Xcode from the Mac App Store. * [AppleDoc](https://github.com/tomaz/appledoc) * [CocoaPods](https://cocoapods.org/) @@ -53,4 +53,4 @@ You must sign a [Contributor License Agreement](https://cla.microsoft.com/) befo ## 5. Contact -If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). +If you have further questions or are running into trouble that cannot be resolved by any of the steps [in our troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/4.1.6/docs/docs/Guide-Installation-Setup.html#troubleshooting), feel free to open an issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index ff636a1e..ad416cbe 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -246,7 +246,7 @@ pod "HockeySDK" #### 3.2.1 Binary Distribution Options -The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK Features. +The default and recommended distribution is a binary (static library) and a resource bundle with translations and images for all SDK features. ```ruby platform :ios, '8.0' @@ -690,12 +690,12 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/ ## 6. Contributing -We're looking forward to your contributions via pull requests. +We're looking forward to your contributions via pull requests on our [GitHub repository](https://github.com/bitstadium/HockeySDK-iOS). ### 6.1 Development environment -* Mac running the latest version of OS X +* A Mac running the latest version of OS X * Get the latest Xcode from the Mac App Store * [AppleDoc](https://github.com/tomaz/appledoc) * [CocoaPods](https://cocoapods.org/) @@ -703,7 +703,7 @@ We're looking forward to your contributions via pull requests. ### 6.2 Code of Conduct - +F This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. @@ -714,4 +714,4 @@ You must sign a [Contributor License Agreement](https://cla.microsoft.com/) befo ## 7. Contact -If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). +If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open [a GitHub issue](https://github.com/bitstadium/HockeySDK-iOS/issues), contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net) or join our [Slack](https://slack.hockeyapp.net). From d0f2a87e04105f9c73256cfb14ccc91f174e6664 Mon Sep 17 00:00:00 2001 From: "Benjamin Scholtysik (Reimold)" Date: Thu, 22 Jun 2017 17:27:33 -0700 Subject: [PATCH 25/25] Fix an annoying typo in the setup template --- docs/Guide-Installation-Setup-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index ad416cbe..33639977 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -703,7 +703,7 @@ We're looking forward to your contributions via pull requests on our [GitHub rep ### 6.2 Code of Conduct -F + This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.