Switch to using new environment detection helper function

This commit is contained in:
Lukas Spieß
2015-11-10 15:36:48 +01:00
parent 3749c697c1
commit 0403243df4
3 changed files with 4 additions and 35 deletions

View File

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

View File

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

View File

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