diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index 3b04626d4f..11e4a616ad 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -152,22 +152,48 @@ @see configureWithIdentifier:delegate: @see configureWithBetaIdentifier:liveIdentifier:delegate: @see startManager + @see disableCrashManager @return The BITCrashManager instance initialized by BITHockeyManager */ @property (nonatomic, retain, readonly) BITCrashManager *crashManager; +/** + Flag the determines wether the Crash Manager should be disabled + + If this flag is enabled, then crash reporting is disabled and no crashes will + be detected and send + + *Default*: _NO_ + @see crashManager + */ +@property (nonatomic, getter = isCrashManagerDisabled) BOOL disableCrashManager; + + /** Reference to the initialized BITUpdateManager module @see configureWithIdentifier:delegate: @see configureWithBetaIdentifier:liveIdentifier:delegate: @see startManager + @see disableUpdateManager @return The BITCrashManager instance initialized by BITUpdateManager */ @property (nonatomic, retain, readonly) BITUpdateManager *updateManager; +/** + Flag the determines wether the Update Manager should be disabled + + If this flag is enabled, then checking for updates and submitting beta usage + analytics will be turned off! + + *Default*: _NO_ + @see updateManager + */ +@property (nonatomic, getter = isUpdateManagerDisabled) BOOL disableUpdateManager; + + ///----------------------------------------------------------------------------- /// @name Environment ///----------------------------------------------------------------------------- diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 4aef3dce10..a5f49f52e1 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -66,6 +66,9 @@ - (id) init { if ((self = [super init])) { + _disableCrashManager = NO; + _disableUpdateManager = NO; + _appStoreEnvironment = NO; _startManagerIsInvoked = NO; @@ -166,11 +169,15 @@ _startManagerIsInvoked = NO; if (_validAppIdentifier) { - BITHockeyLog(@"Setup CrashManager"); - _crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier]; + if (![self isCrashManagerDisabled]) { + BITHockeyLog(@"Setup CrashManager"); + _crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier]; + } - BITHockeyLog(@"Setup UpdateManager"); - _updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment]; + if (![self isUpdateManagerDisabled]) { + BITHockeyLog(@"Setup UpdateManager"); + _updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment]; + } // Only if JMC is part of the project if ([[self class] isJMCPresent]) {