检测TestFlight? [英] Detect TestFlight?

查看:24
本文介绍了检测TestFlight?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更愿意为 TestFlight 和 App Store 使用相同的构建配置.有没有办法在运行时检测应用程序是否已通过 TestFlight 或 App Store 安装?(我的想法是,如果不是通过 App Store 安装,我只会调用 takeOff.)

I would prefer to use the same build configuration for TestFlight vs. App Store. Is there a way to detect at runtime whether the app has been installed via TestFlight or the App Store? (My thinking is I'll only call takeOff if it's not installed via the App Store.)

我想避免在 App Store 版本中使用 TestFlight 来保护我用户的隐私,并避免讨论的网络潜在脱轨 这里.

I want to avoid using TestFlight in App Store builds to protect my users' privacy, and also to avoid the potential derailing of networking discussed here.

推荐答案

我相信这足够接近 检查 iOS 应用是否在应用商店上线 是否可以关闭.

I believe this to be close enough to a duplicate of Check if iOS app is live in app store that this can be closed.

您可以通过检查是否缺少 embedded.mobileprovision 来确定您的应用是否是通过应用商店分发的.此文件仅包含在临时构建中.因此,如果您仅通过 TestFlight 或 HockeyApp 分发构建并且它不是商店构建,则它必须是 TestFlight 或 HockeyApp 构建.

You can determine if your app was distributed via the app store by checking for the absence of embedded.mobileprovision. This file is only included in adhoc builds. It follows that if you're distributing builds only via TestFlight or HockeyApp and it is not a store build, it must be a TestFlight or HockeyApp build.

像这样:

if ([[NSBundle mainBundle] pathForResource:@"embedded"
                                    ofType:@"mobileprovision"]) {
  // not from app store
} else {
  // from app store
}

此技术来自 HockeyApp SDK.

这篇关于检测TestFlight?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆