Fix setting UpdateManager.checkForUpdateOnLaunch to NO disabling usage tracking and expiry check not working

This commit is contained in:
Andreas Linde 2012-08-22 00:16:30 +02:00
parent a227ff9f7a
commit 569833f65e

View File

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