mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Provide alert option to show mandatory update details
The user will then not be able to dismiss to modal presentation and has to install the update from there.
This commit is contained in:
parent
07bf41b232
commit
5ff12626af
@ -513,7 +513,12 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
|
||||
if ([self isPreiOS7Environment])
|
||||
self.barStyle = UIBarStyleBlack;
|
||||
[self showView:[self hockeyViewController:YES]];
|
||||
|
||||
BITUpdateViewController *updateViewController = [self hockeyViewController:YES];
|
||||
if ([self hasNewerMandatoryVersion]) {
|
||||
[updateViewController setMandatoryUpdate: YES];
|
||||
}
|
||||
[self showView:updateViewController];
|
||||
}
|
||||
|
||||
|
||||
@ -527,7 +532,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
|
||||
otherButtonTitles:nil
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"UpdateShow"), nil
|
||||
];
|
||||
[alertView setTag:BITUpdateAlertViewTagMandatoryUpdate];
|
||||
[alertView show];
|
||||
@ -1015,11 +1020,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
||||
|
||||
// invoke the selected action from the action sheet for a location element
|
||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||
if ([alertView tag] == BITUpdateAlertViewTagMandatoryUpdate) {
|
||||
(void)[self initiateAppDownload];
|
||||
_updateAlertShowing = NO;
|
||||
return;
|
||||
} else if ([alertView tag] == BITUpdateAlertViewTagNeverEndingAlertView) {
|
||||
if ([alertView tag] == BITUpdateAlertViewTagNeverEndingAlertView) {
|
||||
[self alertFallback:[alertView message]];
|
||||
return;
|
||||
}
|
||||
|
||||
@ -364,8 +364,11 @@
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
if (_isAppStoreEnvironment)
|
||||
if (_isAppStoreEnvironment) {
|
||||
self.appStoreButtonState = AppStoreButtonStateOffline;
|
||||
} else if (self.mandatoryUpdate) {
|
||||
self.navigationItem.leftBarButtonItem = nil;
|
||||
}
|
||||
_updateManager.currentHockeyViewController = self;
|
||||
[super viewWillAppear:animated];
|
||||
[self redrawTableView];
|
||||
|
||||
@ -69,7 +69,8 @@ typedef NS_ENUM(NSUInteger, AppStoreButtonState) {
|
||||
}
|
||||
|
||||
@property (nonatomic, weak) BITUpdateManager *updateManager;
|
||||
@property (nonatomic, readwrite) BOOL modal;
|
||||
|
||||
@property (nonatomic, readwrite) BOOL mandatoryUpdate;
|
||||
|
||||
@property (nonatomic, assign) AppStoreButtonState appStoreButtonState;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user