应用内购买的产品 ID 是否必须以反向 DNS 开头?

发布于 2024-09-16 18:51:57 字数 132 浏览 4 评论 0原文

应用内购买的产品 ID 是否必须以反向 DNS 开头(如 com.mycompany.My_Awesome_Game.Level_Pack_1),或者可以只是独立的(如 Level_Pack_1)?

Does an In App Purchase's Product ID have to begin with a Reverse-DNS like com.mycompany.My_Awesome_Game.Level_Pack_1 or can it just be standalone like Level_Pack_1?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

街道布景 2024-09-23 18:51:57

产品 ID 可以是您想要的任何内容,但建议您遵循反向域名样式。但最终产品 ID 的命名没有任何限制。它也不需要使用您的应用程序包 ID 作为前缀。

来自来源

问:我正在实施应用内购买
并且必须注册我的产品
标识符。什么是产品
标识符以及如何创建和
在我的应用程序中使用它们吗?

A:产品标识符是一个字符串
用于唯一标识每个
您希望从您的公司出售的产品
应用。 App Store 使用它来
检索有关产品的信息。
它是一个字符串标识符,可以
仅包含字母数字
(AZ,az,0-9)、下划线 (_) 和
句点 (.) 字符。您可以使用任何
这些字符的序列为您
标识符。但是,我们建议
您使用反向域名样式
(例如,
com.公司名称.应用程序.产品ID)
创建标识符时。

因此,“Level_Pack_1”(如您的示例中所示)将是有效的产品 ID。

Product IDs can be whatever you want, although it is recomend you follow the reverse domain name style. But in the end there's no restriction over the naming of your product IDs. It also does not need to use your app bundle ID as a prefix.

From the source:

Q: I am implementing In App Purchase
and must register my product
identifiers. What are product
identifiers and how do I create and
use them in my application?

A: A product identifier is a string
used to uniquely identify every
product you wish to sell from your
application. The App Store uses it to
retrieve information about a product.
It is a string identifier that can
only contain alphanumeric
(A-Z,a-z,0-9), underscore (_), and
period (.) characters. You can use any
sequence of these characters for your
identifier. However, we recommend that
you use the reverse domain name style
(for example,
com.companyname.application.productid)
when creating your identifier.

So 'Level_Pack_1' —as in your example— would be a valid product id.

眼眸印温柔 2024-09-23 18:51:57

这是一个老问题,但自从最近我一直在想同样的问题以来,我就被引导到这里。最终,当我在项目中逐步实施 IAP 时,我已经清楚了这一点:

  1. 如果您不需要 App Store 来托管应用内购买的内容,则产品 ID 可以是字母数字 (A-Za- z0-9)、下划线 (_) 和点 (.);
  2. 如果您确实需要 App Store 来托管内容,则产品 ID 必须是反向 DNS,例如 (com.yourCompany.yourProduct),并且必须与您的应用内购买内容项目的捆绑标识符相匹配。稍后,当您存档内容项目并使用 Xcode 存档上传器上传时,App Store Connect 就知道如何将上传的内容与应用内购买产品关联起来。

This is an old question but I'm directed here since recently I've been wondering about the same question. Eventually as I walked through the implementation of IAP in my project this has become clear to me:

  1. if you don't need App Store to host content for your In-App Purchase the Product ID can be any combination of Alphanumeric (A-Za-z0-9), underscore (_) and dot (.);
  2. if you do need App Store to host content the Product ID must be reverse-DNS like (com.yourCompany.yourProduct) and must match the bundle identifier of your In-App Purchase Content project. Later when you archive the content project and upload it with Xcode archive uploader this is how App Store Connect knows how to associate the uploaded content with the in-app purchase product.
小梨窩很甜 2024-09-23 18:51:57

我已经遇到“没有收到应用内产品(0)”的情况了好几个月,试图解决这个问题。结果:

credits_1 不被允许,但credits1 工作正常!所以,不要使用任何 _- 符号

i have encountered "no in-app products received (0)" for many months tried to solve this problem. the result:

credits_1 was not allowed, but credits1 is working fine! so, don't use any _- symbols

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文