SKProductsRequest does not return SKProductsResponse in Catalyst app

混江龙づ霸主 提交于 2021-01-25 07:06:28

问题


I have an existing iOS app that contains in-app purchases. I've done the following to port it to macoS,

  1. built in Xcode by adding Mac as a target.
  2. added a macOS platform to the existing app on App Store Connect. I did not upload a macOS version yet.
  3. completely log out of App Store.
  4. run app from Finder. I also tested running from the command line to see if there were any console messages that popped up.

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).

I am hoping there's some minor setting in App Store Connect or in my build that I'm missing.

Thanks in advance.


回答1:


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.

This post is basically the same issue with an answer in Swift.



来源:https://stackoverflow.com/questions/61397691/skproductsrequest-does-not-return-skproductsresponse-in-catalyst-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!