问题
I have an existing iOS app that contains in-app purchases. I've done the following to port it to macoS,
- built in Xcode by adding Mac as a target.
- added a macOS platform to the existing app on App Store Connect. I did not upload a macOS version yet.
- completely log out of App Store.
- 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