mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-24 04:00:45 +00:00
Fix setting UpdateManager.checkForUpdateOnLaunch to NO disabling usage tracking and expiry check not working
This commit is contained in:
parent
a227ff9f7a
commit
569833f65e
@ -131,6 +131,17 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)didBecomeActiveActions {
|
||||
if ([self isUpdateManagerDisabled]) return;
|
||||
|
||||
[self checkExpiryDateReached];
|
||||
[self startUsage];
|
||||
|
||||
if (_checkForUpdateOnLaunch) {
|
||||
[self checkForUpdate];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Expiry
|
||||
|
||||
- (BOOL)expiryDateReached {
|
||||
@ -382,8 +393,7 @@
|
||||
[dnc addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil];
|
||||
|
||||
[dnc addObserver:self selector:@selector(stopUsage) name:UIApplicationWillTerminateNotification object:nil];
|
||||
[dnc addObserver:self selector:@selector(checkExpiryDateReached) name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[dnc addObserver:self selector:@selector(startUsage) name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[dnc addObserver:self selector:@selector(didBecomeActiveActions) name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
[dnc addObserver:self selector:@selector(stopUsage) name:UIApplicationWillResignActiveNotification object:nil];
|
||||
}
|
||||
return self;
|
||||
@ -1056,18 +1066,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setCheckForUpdateOnLaunch:(BOOL)flag {
|
||||
if (_checkForUpdateOnLaunch != flag) {
|
||||
_checkForUpdateOnLaunch = flag;
|
||||
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
|
||||
if (flag) {
|
||||
[dnc addObserver:self selector:@selector(checkForUpdate) name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
} else {
|
||||
[dnc removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)currentAppVersion {
|
||||
return _currentAppVersion;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user