From 0403243df43384ee135a9ffa6d67ec7e549fef88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Tue, 10 Nov 2015 15:36:48 +0100 Subject: [PATCH] Switch to using new environment detection helper function --- Classes/BITHockeyHelper.h | 2 -- Classes/BITHockeyHelper.m | 22 ---------------------- Classes/BITHockeyManager.m | 15 ++++----------- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/Classes/BITHockeyHelper.h b/Classes/BITHockeyHelper.h index f32b5d0815..012da489f3 100644 --- a/Classes/BITHockeyHelper.h +++ b/Classes/BITHockeyHelper.h @@ -50,8 +50,6 @@ BOOL bit_isPreiOS7Environment(void); BOOL bit_isPreiOS8Environment(void); BOOL bit_isAppStoreReceiptSandbox(void); BOOL bit_hasEmbeddedMobileProvision(void); -BOOL bit_isRunningInTestFlightEnvironment(void); -BOOL bit_isRunningInAppStoreEnvironment(void); BITEnvironment bit_currentAppEnvironment(void); BOOL bit_isRunningInAppExtension(void); diff --git a/Classes/BITHockeyHelper.m b/Classes/BITHockeyHelper.m index 42a1823929..ef874814b6 100644 --- a/Classes/BITHockeyHelper.m +++ b/Classes/BITHockeyHelper.m @@ -288,28 +288,6 @@ BOOL bit_hasEmbeddedMobileProvision(void) { return hasEmbeddedMobileProvision; } -BOOL bit_isRunningInTestFlightEnvironment(void) { -#if TARGET_IPHONE_SIMULATOR - return NO; -#else - if (bit_isAppStoreReceiptSandbox() && !bit_hasEmbeddedMobileProvision()) { - return YES; - } - return NO; -#endif -} - -BOOL bit_isRunningInAppStoreEnvironment(void) { -#if TARGET_IPHONE_SIMULATOR - return NO; -#else - if (bit_isAppStoreReceiptSandbox() || bit_hasEmbeddedMobileProvision()) { - return NO; - } - return YES; -#endif -} - BITEnvironment bit_currentAppEnvironment(void) { #if TARGET_IPHONE_SIMULATOR return BITEnvironmentOther; diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 34e5e58fe6..d6857e337d 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -155,8 +155,6 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h #if HOCKEYSDK_FEATURE_STORE_UPDATES _enableStoreUpdateManager = NO; #endif - _appEnvironment = BITEnvironmentOther; - _appStoreEnvironment = NO; _startManagerIsInvoked = NO; _startUpdateManagerIsInvoked = NO; @@ -164,18 +162,13 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h _installString = bit_appAnonID(NO); _disableInstallTracking = NO; -#if !TARGET_IPHONE_SIMULATOR + _appStoreEnvironment = NO; // check if we are really in an app store environment - if (bit_isRunningInAppStoreEnvironment()) { - _appEnvironment = BITEnvironmentAppStore; + _appEnvironment = bit_currentAppEnvironment(); + if (_appEnvironment == BITEnvironmentAppStore) { _appStoreEnvironment = YES; - } else if (bit_isRunningInTestFlightEnvironment()) { - _appEnvironment = BITEnvironmentTestFlight; - } else { - _appEnvironment = BITEnvironmentOther; } -#endif - + [self performSelector:@selector(validateStartManagerIsInvoked) withObject:nil afterDelay:0.0f]; } return self;