检查iOS应用是否在应用商店中存在 [英] Check if iOS app is live in app store

查看:495
本文介绍了检查iOS应用是否在应用商店中存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以某种方式在iOS应用程序中进行如下编码?

Is it possible somehow to code like below in iOS app ?

if(app is live in app store)
{
   //Do something
}
else
{
  //Do other thing
}

我想避免我们的QE / Dev团队使用app进行测试的情况。有没有办法可以检测应用程序代码的签名方式(Developer / Adhoc / Distribution)?即使有可能,也不会消除Apple在审核时使用我们的应用进行测试的情况。在我们的应用程序在App Store上线之前,我们记录了Apple的许多内容下载。

I wanted to avoid cases where our QE/Dev team is using app for testing. Is there a way I can detect how app code is signed (Developer/Adhoc/Distribution) to check ? Even if it is possible, it will not eliminate cases when Apple is using our app for testing as part of review. We recorded many downloads of our content by Apple before our app goes live in App store.

推荐答案

您可以通过检查是否缺少embedded.mobileprovision来确定您的应用是否通过应用商店分发。此文件仅包含在adhoc版本中。

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.

喜欢这样:

if ([[NSBundle mainBundle] pathForResource:@"embedded"
                                    ofType:@"mobileprovision"]) {
  // not from app store (Apple's reviewers seem to hit this path)
} else {
  // from app store
}

此技术来自 HockeyApp SDK 。我个人在商店中有使用这种技术的应用程序,当然还有许多分发的应用程序,包括HockeyApp SDK。

This technique is from the HockeyApp SDK. I personally have applications in the store that use this technique, and of course there are many apps distributed that include the HockeyApp SDK.

基于我意外发布的即时崩溃我的应用程序在从应用程序商店路径中的特定版本,Apple的团队将遵循不从应用程序商店的路径。让我的损失成为你的收益。 :)

Based on an immediate crash I accidentally released in a particular build of my application in the "from app store" path, Apple's team will follow the "not from app store" path. Let my loss be your gain on that one. :)

这篇关于检查iOS应用是否在应用商店中存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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