Add properties allowing to disable crash reporting or beta updates

This commit is contained in:
Andreas Linde 2012-08-05 01:23:15 +02:00
parent 4cb93d66ac
commit 90759c7788
2 changed files with 37 additions and 4 deletions

View File

@ -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
///-----------------------------------------------------------------------------

View File

@ -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) {
if (![self isCrashManagerDisabled]) {
BITHockeyLog(@"Setup CrashManager");
_crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier];
}
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]) {