mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-06 22:33:10 +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])
|
if ([self isPreiOS7Environment])
|
||||||
self.barStyle = UIBarStyleBlack;
|
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]]
|
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
|
||||||
delegate:self
|
delegate:self
|
||||||
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
|
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
|
||||||
otherButtonTitles:nil
|
otherButtonTitles:BITHockeyLocalizedString(@"UpdateShow"), nil
|
||||||
];
|
];
|
||||||
[alertView setTag:BITUpdateAlertViewTagMandatoryUpdate];
|
[alertView setTag:BITUpdateAlertViewTagMandatoryUpdate];
|
||||||
[alertView show];
|
[alertView show];
|
||||||
@ -1015,11 +1020,7 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
|
|||||||
|
|
||||||
// invoke the selected action from the action sheet for a location element
|
// invoke the selected action from the action sheet for a location element
|
||||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||||
if ([alertView tag] == BITUpdateAlertViewTagMandatoryUpdate) {
|
if ([alertView tag] == BITUpdateAlertViewTagNeverEndingAlertView) {
|
||||||
(void)[self initiateAppDownload];
|
|
||||||
_updateAlertShowing = NO;
|
|
||||||
return;
|
|
||||||
} else if ([alertView tag] == BITUpdateAlertViewTagNeverEndingAlertView) {
|
|
||||||
[self alertFallback:[alertView message]];
|
[self alertFallback:[alertView message]];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -364,8 +364,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
if (_isAppStoreEnvironment)
|
if (_isAppStoreEnvironment) {
|
||||||
self.appStoreButtonState = AppStoreButtonStateOffline;
|
self.appStoreButtonState = AppStoreButtonStateOffline;
|
||||||
|
} else if (self.mandatoryUpdate) {
|
||||||
|
self.navigationItem.leftBarButtonItem = nil;
|
||||||
|
}
|
||||||
_updateManager.currentHockeyViewController = self;
|
_updateManager.currentHockeyViewController = self;
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
[self redrawTableView];
|
[self redrawTableView];
|
||||||
|
|||||||
@ -69,7 +69,8 @@ typedef NS_ENUM(NSUInteger, AppStoreButtonState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, weak) BITUpdateManager *updateManager;
|
@property (nonatomic, weak) BITUpdateManager *updateManager;
|
||||||
@property (nonatomic, readwrite) BOOL modal;
|
|
||||||
|
@property (nonatomic, readwrite) BOOL mandatoryUpdate;
|
||||||
|
|
||||||
@property (nonatomic, assign) AppStoreButtonState appStoreButtonState;
|
@property (nonatomic, assign) AppStoreButtonState appStoreButtonState;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user