检查iOS应用是否在应用商店中

Check if iOS app is live in app store(检查iOS应用是否在应用商店中)
本文介绍了检查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 团队使用应用程序进行测试的情况.有没有一种方法可以检测应用程序代码的签名方式(开发人员/临时/分发)来检查?即使有可能,它也不会消除 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 来确定您的应用是否通过应用商店分发.此文件仅包含在临时构建中.

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应用是否在应用商店中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)