diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index a48543f6be..5291041ab6 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -163,6 +163,14 @@ } +- (void)setDisableUpdateManager:(BOOL)disableUpdateManager { + if (_updateManager) { + [_updateManager setDisableUpdateManager:disableUpdateManager]; + } + _disableUpdateManager = disableUpdateManager; +} + + - (void)setUpdateURL:(NSString *)anUpdateURL { // ensure url ends with a trailing slash if (![anUpdateURL hasSuffix:@"/"]) { diff --git a/Classes/BITUpdateManager.m b/Classes/BITUpdateManager.m index d30d3ec12f..c64c8f9926 100644 --- a/Classes/BITUpdateManager.m +++ b/Classes/BITUpdateManager.m @@ -342,6 +342,7 @@ _lastCheck = nil; _uuid = [[self executableUUID] retain]; _sendUsageData = YES; + _disableUpdateManager = NO; // set defaults self.showDirectInstallOption = NO; @@ -494,6 +495,7 @@ - (void)showCheckForUpdateAlert { if (_isAppStoreEnvironment) return; + if ([self isUpdateManagerDisabled]) return; if (!_updateAlertShowing) { if ([self hasNewerMandatoryVersion]) { @@ -762,6 +764,7 @@ - (void)checkForUpdate { if (_isAppStoreEnvironment && !_checkForTracker) return; + if ([self isUpdateManagerDisabled]) return; if ([self expiryDateReached]) return; @@ -884,6 +887,8 @@ // begin the startup process - (void)startManager { + if ([self isUpdateManagerDisabled]) return; + BITHockeyLog(@"INFO: Start UpdateManager"); if ([self expiryDateReached]) return; diff --git a/Classes/BITUpdateManagerPrivate.h b/Classes/BITUpdateManagerPrivate.h index c84b56142d..51726531db 100644 --- a/Classes/BITUpdateManagerPrivate.h +++ b/Classes/BITUpdateManagerPrivate.h @@ -64,6 +64,8 @@ // Contains the tracker config if received from server @property (nonatomic, retain) NSDictionary *trackerConfig; +// used by BITHockeyManager if disable status is changed +@property (nonatomic, getter = isUpdateManagerDisabled) BOOL disableUpdateManager; - (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment;