ios iTunes 连接:对捆绑 ID 感到困惑

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17065556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:55:00  来源:igfitidea点击:

iTunes connect: confused on Bundle ID

iosapp-store-connectbundle

提问by mm24

I have been excited to try to add for the FIRST time a new App on iTunes Connect to TEST my GAMEKIT features.

我很高兴第一次尝试在 iTunes Connect 上添加一个新应用程序来测试我的 GAMEKIT 功能。

I have read thistechnical note and I am getting confused because I had already a boundle id for my App that I created when I started developing it (that's my current bundle id with which I created the current provisioning and testing profiles: hello-*).

我已经阅读了这篇技术说明,但我感到很困惑,因为我在开始开发时已经为我的应用程序创建了一个边界 ID(这是我创建当前配置和测试配置文件的当前包 ID:hello-*) .

enter image description here

enter image description here

In order to use GameKit and InApp Purchase should I create a new Bundle Id?

为了使用 GameKit 和 InApp Purchase,我应该创建一个新的 Bundle Id 吗?

I am confused because:

我很困惑,因为:

  • I don't know if the current Bundle Id is valid (in respect to the technical note linked above)
  • I don't know if hte Bundle Id influences the things that I can ADD in the App later (E.g. in App Purchase, GameKit, ...)
  • If I create a new App with a name (say: HelloApple) but with a bundle Id with wildcard (Say: hello-*) will I be able to add a new App with the same name but a different bundle Id in a later stage? This indeed before publishing ANY of the two Apps.
  • I don't fully understand why there is a choice between using or not using a wildcard; in other words, if a non wildcard bundle id is needed to use in App purchase and GameKit why should a developer want to use a wildcard App Id?
  • 我不知道当前的 Bundle Id 是否有效(关于上面链接的技术说明)
  • 我不知道 hte Bundle Id 是否会影响我以后可以在应用程序中添加的内容(例如在应用程序购买中,GameKit,...)
  • 如果我创建一个具有名称(例如:HelloApple)但具有带通配符的捆绑 ID(例如:hello-*)的新应用程序,我将能够在稍后阶段添加具有相同名称但具有不同捆绑 ID 的新应用程序? 这确实在发布任何两个应用程序之前。
  • 我不完全理解为什么要在使用或不使用通配符之间做出选择;换句话说,如果在 App 购买和 GameKit 中需要使用非通配符 bundle id,那么开发者为什么要使用通配符 App Id?

Any help will be appreciated, in particular I need to solve my first issue: which bundle Id should I use in ordert to use GameKit and InAppPurchase?

任何帮助将不胜感激,特别是我需要解决我的第一个问题:我应该使用哪个包 ID 来使用 GameKit 和 InAppPurchase?

回答by Roberto Canogar

Before answering your questions some definitions:

在回答您的问题之前,先做一些定义:

Bundle ID: A reverse DNS string that precisely identifies a single app.

Bundle ID:精确识别单个应用程序的反向 DNS 字符串。

Bundle ID search string: it is used to match a set of bundle IDs, where each bundle ID identifies a single app. For example, if the bundle ID search string is com.mycompany.MyAppor a wildcard such as com.mycompany.*, then it will match the bundle ID com.mycompany.MyApp.

Bundle ID 搜索字符串:用于匹配一组bundle ID,其中每个bundle ID 标识一个应用程序。例如,如果包 ID 搜索字符串是com.mycompany.MyApp或通配符,例如com.mycompany.*,则它将匹配包 ID com.mycompany.MyApp

App ID: A string that identifies one or more apps from a single team. An App ID consists of a bundle ID search stringpreceded by the Team ID, a 10-character string generated by Apple to uniquely identify a team. In the technical notethat you link it is ABCDE12345and called the Bundle Seed ID.

App ID:一个字符串,用于标识来自单个团队的一个或多个应用程序。App ID 由一个包 ID 搜索字符串组成,前面是Team ID,这是一个由 Apple 生成的 10 个字符的字符串,用于唯一标识一个团队。在您链接它的技术说明中,它被ABCDE12345称为捆绑种子 ID。

(Development) Provisioning Profile: you use it to authorize your app to launch on devices and use certain store technologies when you are in development. It is comprised of: a single App ID, a set of devices, and a set of development certificates. The provisioning profiles are created in Member Center and you need them on your device to run your app. XCode can download provisioning profiles and install them onto devices.

(开发)配置文件:您可以使用它来授权您的应用在设备上启动并在您进行开发时使用某些商店技术。它包括:单个 App ID、一组设备和一组开发证书。配置文件是在会员中心创建的,您需要在您的设备上使用它们来运行您的应用程序。XCode 可以下载配置文件并将它们安装到设备上。

Now I will answer to your bullets:

现在我来回答你的子弹:

  • To use Game-Center (GameKit) and IAP you need an explicit App ID, that is and App ID with a bundle ID search stringthat has no *. A wild-card App IDis one in which the bundle ID search stringthat has a *, and is the one you have now.
  • What you create initially is an App ID with an associated Bundle ID. If it is explicit you can add Game-Center and IAP, if it is a wildcard App ID not... that's it.
  • You can not have two apps with different names but the same explicit App ID or Bundle ID. But you can have two apps with different names that do not use Game-Center or IAP with a unique App ID using a wildcard App ID.
  • You ask why the wildcard is useful... Well, I said that if you do not use Game-Center or IAP you can have two or more apps associated to an wildcard App ID. Then you can create a provisioning profile with this App ID and you only need to install this provisioning profile on your devices for all your apps. There is a default provisioning profile of this type called the Team Provisioning Profilewhich is valid for all your apps, but you could create more specific ones that are valid for a subset of all you apps.
  • 要使用 Game-Center (GameKit) 和 IAP,您需要一个明确的 App ID,即 App ID 和一个不带 *的捆绑 ID 搜索字符串。一个通配符的App ID是一个在其中捆绑ID搜索字符串,有一个*,并且是你现在有一个。
  • 您最初创建的是一个带有关联 Bundle ID 的 App ID。如果是明确的,您可以添加 Game-Center 和 IAP,如果它是通配符 App ID,则不是……就是这样。
  • 您不能有两个名称不同但显式 App ID 或 Bundle ID 相同的应用。但是您可以拥有两个不同名称的应用程序,它们不使用 Game-Center 或 IAP,并且具有使用通配符应用程序 ID 的唯一应用程序 ID。
  • 你问为什么通配符有用……好吧,我说如果你不使用 Game-Center 或 IAP,你可以有两个或多个应用程序关联到一个通配符应用程序 ID。然后,您可以使用此 App ID 创建配置文件,您只需在您的设备上为所有应用程序安装此配置文件。这种类型的默认配置文件称为Team Provisioning Profile,它对您的所有应用程序都有效,但您可以创建更具体的对所有应用程序的子集有效的配置文件。

This process is really useful for big teams. If you have a small team and few apps it is really confusing, but it helps to understand the reasoning behind it.

这个过程对大团队非常有用。如果你有一个小团队和很少的应用程序,这真的很令人困惑,但它有助于理解其背后的推理。

But there is more to say about all this. I recommend that you read the "App Distribution Guide" as I did recently. It is an extensive guide, but for the moment you only need to read sections of topic "Maintaining Your Signing Identities and Certificates" and "Maintaining Identifiers, Devices, and Profiles". The guide is very clear, full of screenshots and it will answer all your questions. Also you can go back to the guide down the road to quickly solve some issue (and you will have issues).

但关于这一切还有更多要说的。我建议您像我最近所做的那样阅读“应用程序分发指南”。这是一份详尽的指南,但目前您只需要阅读主题“维护您的签名身份和证书”和“维护标识符、设备和配置文件”的部分。该指南非常清晰,充满了屏幕截图,它将回答您的所有问题。您也可以在路上返回指南以快速解决某些问题(并且您会遇到问题)。

The first time that I created an App with Game-Center and IAP more than a year ago I looked up stackoverflow to answer all my questions. But I've been having issues when certificates expired, when I added new devices, etc, and every time I found and Ad-hoc solution after a lot of fiddling around and going back to stackoverflow. Don't get me wrong, there are great answers in stackoverflow but it is a much better strategy in my experience to read something longer that explains the big picture. App ID, Bundle ID's, Certificates, private keys, etc, is a messy subject, specially if you do not understand why it is built this way.

一年多前,我第一次使用 Game-Center 和 IAP 创建应用程序时,我查找了 stackoverflow 来回答我所有的问题。但是当证书过期时,当我添加新设备等时,我一直遇到问题,每次我都在摆弄并返回stackoverflow后找到临时解决方案。不要误会我的意思,stackoverflow 中有很好的答案,但根据我的经验,阅读更长的解释大局的内容是一个更好的策略。App ID、Bundle ID、证书、私钥等是一个杂乱的主题,特别是如果您不明白为什么要以这种方式构建它。

回答by Gianluca Tranchedone

The bundle id is just an identifier for your app. It's mainly used to provide you with the certificates you need to use to sign your app before submitting to the App Store or to use it on development devices (e.g. for testing). The bundle id can be whatever you want. Apple recommends using the syntax com.yourcompany.yourappto keep it consistent among apps you develop and avoid conflicts with other app's identifiers.

bundle id 只是您的应用程序的标识符。它主要用于在提交到 App Store 或在开发设备上使用它(例如用于测试)之前为您提供用于签署应用程序所需的证书。bundle id 可以是任何你想要的。Apple 建议使用该语法com.yourcompany.yourapp在您开发的应用程序之间保持一致,并避免与其他应用程序的标识符发生冲突。

A wildcard can be used on all your apps, while a specific id can be used with one app only. I advice you to have an id for each of your app and only a wildcard for development (so you can run on your devices as many apps as you want without having to bother about the certificates until you decide to ship the app). You don't need to have access to all services (like Game Center or iCloud) on all your apps and therefore you better sign the single certificates just with the services your app needs.

通配符可用于您的所有应用程序,而特定 ID 只能用于一个应用程序。我建议您为每个应用程序设置一个 id,并且只有一个用于开发的通配符(这样您就可以在您的设备上运行任意数量的应用程序,而无需担心证书问题,直到您决定发布该应用程序)。您不需要访问所有应用程序上的所有服务(如 Game Center 或 iCloud),因此您最好只使用应用程序所需的服务签署单个证书。

回答by user2050128

What I think Apple wants is:

我认为苹果想要的是:

  1. Create a different bundle ID for each app that uses in-App purchase/GameKit or both.

  2. You can have same App-ID, and bundle ID for apps that do not use these.

  3. If the bundleID you have for your app is not used for any other of your apps, you can use it.

  1. 为每个使用应用内购买/GameKit 或两者的应用创建不同的捆绑 ID。

  2. 对于不使用这些的应用程序,您可以拥有相同的 App-ID 和捆绑 ID。

  3. 如果您的应用程序的 bundleID 未用于任何其他应用程序,您可以使用它。

Somebody more knowledgable, Please correct me if I am wrong.

有更懂的人,如果我错了,请纠正我。