SKProductsRequest 不会在 Catalyst 应用程序中返回 SKProductsResponse [英] SKProductsRequest does not return SKProductsResponse in Catalyst app
问题描述
我有一个包含应用内购买的现有 iOS 应用.我已完成以下操作以将其移植到 macoS,
I have an existing iOS app that contains in-app purchases. I've done the following to port it to macoS,
- 通过添加 Mac 作为目标在 Xcode 中构建.
- 为 App Store Connect 上的现有应用添加了 macOS 平台.我还没有上传 macOS 版本.
- 完全退出 App Store.
- 从 Finder 运行应用程序.我还测试了从命令行运行,看看是否有任何弹出的控制台消息.
如您所想,我创建了一个 SKProductsRequest 对象并调用了 start().虽然 iOS 版本恢复正常,但 macOS 版本不返回任何内容(或者至少它不通过 productsRequest 返回 SKProductsResponse).
As you can imagine, I create an SKProductsRequest object and call start(). Whereas the iOS version comes back fine, the macOS version does not return anything (or at least it's not returning a SKProductsResponse through productsRequest).
我希望 App Store Connect 或我的构建中有一些我遗漏的小设置.
I am hoping there's some minor setting in App Store Connect or in my build that I'm missing.
提前致谢.
推荐答案
我遇到了同样的问题.我必须添加对我的 SKProductsRequest
的强引用,以便在为 Mac 构建/测试时返回.对于 iOS,它不需要强引用即可工作.
I had this same issue. I had to add a strong reference to my SKProductsRequest
for it to return when building/testing for Mac. For iOS, it didn't ever need the strong reference to work.
这篇关于SKProductsRequest 不会在 Catalyst 应用程序中返回 SKProductsResponse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!