mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-20 11:09:45 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user