StoreKit 2 - 产品请求始终为空

发布于 2025-01-16 22:49:27 字数 561 浏览 0 评论 0原文

我尝试使用 StoreKit 2App Store Connect 获取产品,但始终返回空数组:

let keys = [
    "com.app.suscripcion.mes.1"
]
        
let storeProducts = try await Product.products(for: keys)

我在 InApp Purchase< 上添加了一个密钥/code> 部分:

输入图片描述这里

我需要做什么才能从 App Store Connect 获取产品?如果我使用 .storekit 配置文件,它可以工作,但在真实场景中不起作用

I'm trying to fetch the products from the App Store Connect using StoreKit 2 but always returns an empty array:

let keys = [
    "com.app.suscripcion.mes.1"
]
        
let storeProducts = try await Product.products(for: keys)

I had added a key on the InApp Purchase section:

enter image description here

What do I have to do to fetch the products from the App Store Connect? If I use a .storekit configuration file it works but with a real scenario doesn't work

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

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

发布评论

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

评论(3

千紇 2025-01-23 22:49:27

要解决此问题,App Store Connect 中的帐户持有人需要在协议、税务和银行业务设置税务和银行业务到付费应用程序,以便从App Store Connect获取应用内购买产品:

在此处输入图像描述

之后,付费应用程序类型的状态需要更改为活动 才能使其正常工作。

To solve this problem, the Account Holder from App Store Connect, inside Agreements, Tax, and Banking, needs to Set Up Tax and Banking to Paid Apps in order to get the InApp Purchase products from App Store Connect:

enter image description here

After that, the Status for the Paid Apps Type need to change to Active in order to make it work.

要走就滚别墨迹 2025-01-23 22:49:27

检查执行的方案的选项中的 StoreKit Configuration 值是否设置为 none。

Check if the StoreKit Configuration value is set to none in the options of the scheme that was executed.

伴梦长久 2025-01-23 22:49:27

确保您在此方法中传递了产品订阅的标识符,而不是错误地传递了应用程序的捆绑包标识符:

尝试等待 Product.products(for: ["my_monthly_subscription"])

尝试等待 Product.products(for: ["com.mycompany.myapp"])

Make sure you're passing the identifier of the Product or Subscription in this method and not the app's bundle identifier by mistake:

try await Product.products(for: ["my_monthly_subscription"])

try await Product.products(for: ["com.mycompany.myapp"])

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