diff --git a/Classes/BITStoreUpdateManager.h b/Classes/BITStoreUpdateManager.h index 1b138e61d8..799d7dc6f1 100644 --- a/Classes/BITStoreUpdateManager.h +++ b/Classes/BITStoreUpdateManager.h @@ -131,6 +131,34 @@ typedef enum { @property (nonatomic, assign, getter=isCheckingForUpdateOnLaunch) BOOL checkForUpdateOnLaunch; +///----------------------------------------------------------------------------- +/// @name User Interface +///----------------------------------------------------------------------------- + + +/** + Flag that determines if the integrated update alert should be used + + If enabled, the integrated UIAlert based update notification will be used to inform + the user about a new update being available in the App Store. + + If disabled, you need to implement the `BITStoreUpdateManagerDelegate` protocol with + the method `[BITStoreUpdateManagerDelegate detectUpdateFromStoreUpdateManager:version:]` + to be notified about new version and proceed yourself. + The manager will consider this identical to an `Ignore` user action using the alert + and not inform about this particular version any more, unless the app is updated + and this very same version shows up at a later time again as a new version. + + *Default*: _YES_ + + @warning If the HockeySDKResources bundle is missing in the application package, then the internal + update alert is also disabled and be treated identical to manually disabling this + property. + @see updateSetting + */ +@property (nonatomic, assign, getter=isUpdateUIEnabled) BOOL updateUIEnabled; + + // manually start an update check /** Check for an update diff --git a/Classes/BITStoreUpdateManager.m b/Classes/BITStoreUpdateManager.m index 9959dab777..a1e0ac1422 100644 --- a/Classes/BITStoreUpdateManager.m +++ b/Classes/BITStoreUpdateManager.m @@ -87,6 +87,7 @@ _enableStoreUpdateManager = NO; _didSetupDidBecomeActiveNotifications = NO; _updateAlertShowing = NO; + _updateUIEnabled = YES; _newStoreVersion = nil; _appStoreURL = nil; _currentUUID = [[self executableUUID] copy]; @@ -271,8 +272,12 @@ [self.delegate detectedUpdateFromStoreUpdateManager:self newVersion:_newStoreVersion]; } - if (BITHockeyBundle()) { + if (self.updateUIEnabled && BITHockeyBundle()) { [self showUpdateAlert]; + } else { + // Ignore this version + [self.userDefaults setObject:_newStoreVersion forKey:kBITStoreUpdateIgnoreVersion]; + [self.userDefaults synchronize]; } }