2809 force newest version

This commit is contained in:
Arnfried Griesert
2022-03-31 05:52:47 +00:00
committed by Frank Rotermund
parent d0203ecec4
commit 594b22ddab
13 changed files with 300 additions and 35 deletions
@@ -309,6 +309,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
{
[super viewDidAppear:animated];
[self checkAppVersion];
// Release the current selected item (if any) except if the second view controller is still visible.
if (self.splitViewController.isCollapsed)
{
@@ -2486,4 +2488,54 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro
return [image vc_notRenderedImage];
}
#pragma mark - Bwi Check App version
- (void)checkAppVersion {
ValidAppVersionsDefaultService *appVersionsService = [[ValidAppVersionsDefaultService alloc] init];
if( BuildSettings.bwiCheckAppVersion && appVersionsService.isCurrentAppVersionDeprecated ) {
MXWeakify(self);
UIAlertController *errorAlert = [UIAlertController alertControllerWithTitle:[VectorL10n bwiOutdatedVersionWarningTitle]
message:[VectorL10n bwiOutdatedVersionWarningMessage]
preferredStyle:UIAlertControllerStyleAlert];
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n bwiOutdatedVersionAppstoreButton]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[self logout];
[self gotoAppStore];
MXStrongifyAndReturnIfNil(self);
self->currentAlert = nil;
}]];
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n bwiOutdatedVersionLogoutButton]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[self logout];
}]];
[self presentViewController:errorAlert animated:YES completion:nil];
}
}
-(void) logout {
[self startActivityIndicator];
MXWeakify(self);
[[AppDelegate theDelegate] logoutWithConfirmation:NO completion:^(BOOL isLoggedOut) {
MXStrongifyAndReturnIfNil(self);
[self stopActivityIndicator];
}];
}
-(void) gotoAppStore {
NSString *iTunesLink = @"itms://itunes.apple.com/app/BwMessenger/id1518548153?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink] options:@{} completionHandler:nil];
}
@end