I'm developing iOS app and need to identify the environment where the app is running to classify the API endpoint. I want to know the app is running under whether production, simulator and also Test Flight. I've already done classifying production and simulator by User-defined setting, but am still not sure how I can identify Test Flight. Any tips? thanks!
If you are asking to get this information from within the app, you can get all this from appStoreReceiptURL
of NSBundle
From apple documentation...
For an application purchased from the App Store, use this application bundle property to locate the receipt. This property makes no guarantee about whether there is a file at the URL—only that if a receipt is present, that is its location.
NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent
For implementation refer to this question