Added new delegate for update process before exit

New delegate `updateManagerWillExitApp` for `BITUpdateManager` that is invoked right before the app wil exit to allow app update to start (>= iOS 8 only)
This commit is contained in:
Andreas Linde
2014-10-24 01:23:34 +02:00
parent a93df35d7d
commit 3356b1df1f
2 changed files with 19 additions and 0 deletions

View File

@@ -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);

View File

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