Fix Re-entering the app doesn't trigger check for updates

https://github.com/bitstadium/HockeySDK-iOS/issues/4
This commit is contained in:
Andreas Linde
2012-08-31 15:30:25 +02:00
parent 504487ad12
commit 3d4d0bc719
2 changed files with 12 additions and 2 deletions

View File

@@ -94,6 +94,8 @@ typedef enum {
BOOL _isAppStoreEnvironment;
BOOL _checkForUpdateOnLaunchOfBitUpdateManager;
NSString *_uuid;
}

View File

@@ -131,9 +131,12 @@
}
- (void)didBecomeActiveActions {
_checkForUpdateOnLaunchOfBitUpdateManager = YES;
if (![self isUpdateManagerDisabled]) {
[self checkExpiryDateReached];
[self startUsage];
[self checkForUpdate];
}
}
@@ -350,6 +353,7 @@
_sendUsageData = YES;
_disableUpdateManager = NO;
_checkForTracker = NO;
_checkForUpdateOnLaunchOfBitUpdateManager = NO;
// set defaults
self.showDirectInstallOption = NO;
@@ -909,7 +913,9 @@
}
} else {
if ([self checkForTracker] || ([self isCheckForUpdateOnLaunch] && [self shouldCheckForUpdates])) {
[self performSelector:@selector(checkForUpdate) withObject:nil afterDelay:1.0f];
if (!_checkForUpdateOnLaunchOfBitUpdateManager) {
[self performSelector:@selector(checkForUpdate) withObject:nil afterDelay:1.0f];
}
}
}
} else {
@@ -917,7 +923,9 @@
// if we are in the app store, make sure not to send usage information in any case for now
_sendUsageData = NO;
[self performSelector:@selector(checkForUpdate) withObject:nil afterDelay:1.0f];
if (!_checkForUpdateOnLaunchOfBitUpdateManager) {
[self performSelector:@selector(checkForUpdate) withObject:nil afterDelay:1.0f];
}
}
}
}