In-App Purchases Not Working in Mac Catalyst

Hi all,


I'm porting an iOS application that uses in-app purchases to Mac by using Catalyst. The Mac build and the iOS build share the same bundle identifier ("Use iOS Bundle Identifier" is checked in the Signing & Capabilities tab), and I use the same code to get product information:


let productRequest = SKProductsRequest(productIdentifiers: productIdentifiers)
productRequest.delegate = self
productRequest.start()


In iOS, the delegate method:

func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
     ...

...gets called consistently after the products request is started, and I can use the response to implement specific purchases later. For some reason, this delegate method never gets called on Mac even though I'm using the same product identifiers. Does anyone know how to fix this issue? Maybe there's something I should be doing within iTunes Connect? Any help would be greatly appreciated!

Accepted Reply

Nevermind, the problem seems to be that I wasn't keeping a permanent reference to productRequest. Here's what I did to fix the issue:


var productRequest: SKProductsRequest!
...
productRequest = SKProductsRequest(productIdentifiers: productIdentifiers)
productRequest.delegate = self
productRequest.start()

Replies

Nevermind, the problem seems to be that I wasn't keeping a permanent reference to productRequest. Here's what I did to fix the issue:


var productRequest: SKProductsRequest!
...
productRequest = SKProductsRequest(productIdentifiers: productIdentifiers)
productRequest.delegate = self
productRequest.start()