diff --git a/Classes/BITUpdateManager.m b/Classes/BITUpdateManager.m index 875bbf3786..f58878854b 100644 --- a/Classes/BITUpdateManager.m +++ b/Classes/BITUpdateManager.m @@ -113,6 +113,10 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) { // we only care about iOS 8 or later if (bit_isPreiOS8Environment()) return; + if (self.delegate != nil && [self.delegate respondsToSelector:@selector(updateManagerWillExitApp:)]) { + [self.delegate updateManagerWillExitApp:self]; + } + // for now we simply exit the app, later SDK versions might optionally show an alert with localized text // describing the user to press the home button to start the update process exit(0); diff --git a/Classes/BITUpdateManagerDelegate.h b/Classes/BITUpdateManagerDelegate.h index 4d12646a41..8e557195ae 100644 --- a/Classes/BITUpdateManagerDelegate.h +++ b/Classes/BITUpdateManagerDelegate.h @@ -106,6 +106,21 @@ - (BOOL)updateManagerShouldSendUsageData:(BITUpdateManager *)updateManager; +///----------------------------------------------------------------------------- +/// @name Privacy +///----------------------------------------------------------------------------- + +/** + Invoked right before the app will exit to allow app update to start (>= iOS8 only) + + The iOS installation mechanism only starts if the app the should be updated is currently + not running. On all iOS versions up to iOS 7, the system did automatically exit the app + in these cases. Since iOS 8 this isn't done any longer. + + */ +- (void)updateManagerWillExitApp:(BITUpdateManager *)updateManager; + + #pragma mark - Deprecated ///-----------------------------------------------------------------------------