如何检查应用程序是从 TestFlight 还是 App Store 启动的?

How to check if app launched from TestFlight or App Store?

我想检查我的应用程序是从 TestFlight 应用程序还是 AppStore 应用程序打开的。

我做了一个测试,当从 TestFlight 启动它时,在 didFinishLaunchingWithOptions 中找到了这个信息:

if launchOptions?[UIApplicationLaunchOptionsKey.sourceApplication] as? String == "com.apple.TestFlight" {
    // ...
}

但我不知道如何检查应用程序是否从 AppStore 打开。标识符是什么?

感谢您的帮助。

App Store iOS 应用程序的捆绑包标识符是 com.apple.AppStore