如何知道已安装的应用程序是通过TestFlight还是AppStore安装的?

时间:2019-04-19 09:28:06

标签: ios app-store testflight

我想了解如何检查通过TestflightAppStore是否安装了用户安装的应用程序。因此,基于此,我想在整个应用程序中进行一些环境更改。

无论如何,都可以通过编码找到它。苹果是否为此提供API

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

我发现了一些小片段,以了解如何通过TestFlight安装应用程序。

在这里,appStoreReceiptURL是一个实例属性,我们可以从主捆绑包中找到它。

enter image description here

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