7

I want to know about how to check user installed application is installed via Testflight or AppStore. So based on that I want to make some environmental change in whole application.

Is there anyway to find that by coding. Is Apple is providing any API for it?

Any help will be appreciated.

  • Testflight is for the beta testing.. how users can download your app from there ?? – dahiya_boy Apr 19 '19 at 09:37
  • Some of my testers are testing from testflight and sometimes they are downloading application from AppStore to check live application. So I want to know whether they have downloaded application from Testflight or AppStore. – Darshan Kunjadiya Apr 19 '19 at 09:40
  • Does this answer your question? [How to tell at runtime whether an iOS app is running through a TestFlight Beta install](https://stackoverflow.com/questions/26081543/how-to-tell-at-runtime-whether-an-ios-app-is-running-through-a-testflight-beta-i) – Max MacLeod May 25 '23 at 10:46

1 Answers1

8

I found little snippet about how to know if application is installed via TestFlight.

Here, appStoreReceiptURL is an instance property, which we can find from main bundle.

enter image description here

func isTestFlight() -> Bool {
    guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else {
    return false
    }
    return appStoreReceiptURL.lastPathComponent == "sandboxReceipt"
}