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:
Andreas Linde 2014-01-07 19:20:38 +01:00
parent 07bf41b232
commit 5ff12626af
3 changed files with 14 additions and 9 deletions

View File

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

View File

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

View File

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