Properly check for identification before calling BITUpdateManager startManager only if the user is identified or JMC is setup

Also fixes a problem when Authenticator was excluded but UpdateManager was included.
This commit is contained in:
Andreas Linde 2013-10-10 03:07:29 +02:00
parent 2788b749d8
commit 5f87227e76

View File

@ -240,15 +240,23 @@
#endif /* HOCKEYSDK_FEATURE_AUTHENTICATOR */ #endif /* HOCKEYSDK_FEATURE_AUTHENTICATOR */
#if HOCKEYSDK_FEATURE_UPDATES #if HOCKEYSDK_FEATURE_UPDATES
// Setup UpdateManager BOOL jmcIsPresent = NO;
if (![self isUpdateManagerDisabled] BOOL isIdentified = NO;
#if HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT #if HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT
|| [[self class] isJMCPresent] jmcIsPresent = [[self class] isJMCPresent]
#endif /* HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT */ #endif /* HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT */
) {
if ([self.authenticator isIdentified]) { #if HOCKEYSDK_FEATURE_AUTHENTICATOR
[self invokeStartUpdateManager]; if (![self isAppStoreEnvironment])
} isIdentified = [self.authenticator isIdentified];
#endif /* HOCKEYSDK_FEATURE_AUTHENTICATOR */
// Setup UpdateManager
if (
(![self isUpdateManagerDisabled] && isIdentified) ||
jmcIsPresent) {
[self invokeStartUpdateManager];
} }
#endif /* HOCKEYSDK_FEATURE_UPDATES */ #endif /* HOCKEYSDK_FEATURE_UPDATES */
} }
@ -307,12 +315,8 @@
[object valueForKey:@"isIdentified"] ) { [object valueForKey:@"isIdentified"] ) {
if (![self isAppStoreEnvironment]) { if (![self isAppStoreEnvironment]) {
BOOL identified = [(NSNumber *)[object valueForKey:@"isIdentified"] boolValue]; BOOL identified = [(NSNumber *)[object valueForKey:@"isIdentified"] boolValue];
if (identified) { if (identified && ![self isUpdateManagerDisabled]) {
#if HOCKEYSDK_FEATURE_UPDATES [self invokeStartUpdateManager];
if (![self isUpdateManagerDisabled]) {
[self invokeStartUpdateManager];
}
#endif
} }
} }
#if HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT #if HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT