Receipt validation in Mac Catalyst

Hi all,

I'm currently struggling with implementing In-App purchase in a Mac Catalyst app. After solving (at least some) hurdles building the appropriate OpenSSL libraries, receipt validation is the next challenge:

In the past I used a 3rd party tool ("Receigen") to validate receipts and extract e.g. IAP information. It looks like the Mac Catalyst build is not receiving any receipt the same as an iOS app. My first assumption was a different path in the app bundle (like under macOS), but so far I couldn't locate any receipt...

Is receipt validation (and IAP) supported for Mac Catalyst apps? Is there any information about the corresponding receipt location, and how validation should happen? The process is quite different between iOS and macOS...

Any help is highly appreciated, Mattes
Answered by MyMattes in 655527022
Today I re-tested with macOS 11 "Big Sur" and Xcode 12.3 (12C33): Receipt validation with Receigen just works with Mac Catalyst, using the iOS header: My app is retrieving the receipt and evaluating IAPs with "CheckInAppPurchasesAndReceipt" successfully. So far only tested in the sandbox as even with Big Sur my app doesn't provide the user experience I'm willing to ship...

Cheers, Mattes
Looks like I'm not the only one... Any ideas?
I was able to get it to work when I logged in to a test account created in Connect. It didn't work when using my real id. Also, you may need to do this:

  #if targetEnvironment(macCatalyst)
    if !FileManager.default.fileExists(atPath:Bundle.main.appStoreReceiptURL.path) {
        exit(173);
    }
#endif

I remember it was necessary to force a mac app to download a receipt from the store. Once the receipt is downloaded, the app will restart.

Best,
jaime
Hey Jaime,

thanks for mentioning the exit(173) ... I completely forgot it is required to request the receipt on macOS (although I'm using it in other apps). Will shortly give it a try and let you all know! At the moment I have classified the Mac Catalyst app "internal use only" as it still has some hick-ups and is not yet mature enough for production...

Greetings, Mattes
Accepted Answer
Today I re-tested with macOS 11 "Big Sur" and Xcode 12.3 (12C33): Receipt validation with Receigen just works with Mac Catalyst, using the iOS header: My app is retrieving the receipt and evaluating IAPs with "CheckInAppPurchasesAndReceipt" successfully. So far only tested in the sandbox as even with Big Sur my app doesn't provide the user experience I'm willing to ship...

Cheers, Mattes
Receipt validation in Mac Catalyst
 
 
Q