From 5d81bc60d506cf25855a5d28f15a9d80c3ab7a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Tue, 10 Nov 2015 15:52:33 +0100 Subject: [PATCH] Add comments to environment detection --- Classes/BITHockeyHelper.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/BITHockeyHelper.m b/Classes/BITHockeyHelper.m index 20a07a3c40..053cc3d8ce 100644 --- a/Classes/BITHockeyHelper.m +++ b/Classes/BITHockeyHelper.m @@ -292,15 +292,21 @@ BITEnvironment bit_currentAppEnvironment(void) { #if TARGET_IPHONE_SIMULATOR return BITEnvironmentOther; #else + + // MobilePovision profiles are a clear indicator for Ad-Hoc distribution if (bit_hasEmbeddedMobileProvision()) { return BITEnvironmentOther; } + + // TestFlight is only supported from iOS 8 onwards, so at this point we have to be in the AppStore if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { return BITEnvironmentAppStore; } + if (bit_isAppStoreReceiptSandbox()) { return BITEnvironmentTestFlight; } + return BITEnvironmentAppStore; #endif }