Maybe this question is a duplicate but I can't find an answer.
My company wants to implement 3 different environments:
As far as I know:
#if DEBUG
it's not executed when a build is in TestFlight.
Is there a way to know when it is TestFlight or AppStore build?
Thank you
Update: There used to be a method to differentiate between Appstore and testflight releases but apple seems to have removed it's support and it no longer works. So, as of now we can't differentiate between Appstore and testflight installs.
This was the method that used to work previously:
let isTestflight = Bundle.main.appStoreReceiptURL?.path.contains("sandboxReceipt")
You can use the same syntax for checking if it's Testflight or Appstore using RELEASE
keyword:
#if RELEASE
print("RELEASE")
#elseif DEBUG
print("DEBUG")
#endif