At WWDC 2020, Apple introduced the ability to do local StoreKit testing in Xcode (that is, testing without connecting to App Store servers and without using sandbox accounts). I am interested in an answer to the question of whether RevenueCat supports local StoreKit testing in Xcode for a RevenueCat-enabled Mac Catalyst app. As you’ll see below, I’ve been getting a “receipt not valid” error when I attempt that kind of testing for a RevenueCat-enabled Mac Catalyst app.
Apple's documentation on StoreKit testing in Xcode indicates that local StoreKit testing does work for Mac apps (on a Mac running Xcode 12 or later, and macOS 11 or later). And in its own documentation, RevenueCat gives instructions for setting up local StoreKit testing in Xcode. What's not clear is whether StoreKit testing in Xcode works with the combination of RevenueCat and Mac Catalyst apps.
I followed RevenueCat's instructions (just noted in the last paragraph) for setting up local StoreKit testing in Xcode (importantly, also uploading the public certificate to RevenueCat's website). That local StoreKit testing works perfectly with the iOS version of my app. And the local StoreKit testing initially appears to work perfectly with the Mac Catalyst version of the app. Here, though, is what happens when I try testing the Mac Catalyst version:
-
When I attempt to make a purchase in the Mac Catalyst version, I get the standard Apple prompt with the title, "Confirm Your In-App Purchase", the question, "Do you want to buy tin-app purchase X]?", and the specification of "tEnvironment: Xcode]."
-
When I click the "Buy" button on that prompt, I get the standard Apple prompt for a successful purchase, "You're all set. Your purchase was successful. cEnvironment: Xcode]."
-
When I click the "OK" button on that prompt, though, I am subsequently greeted with an "Invalid App Store Receipt" error message.
Here is the relevant RevenueCat debug log from Xcode (with two {}-bracketed descriptions where specific values appeared in the log):
Does anyone have any idea why the "receipt is not valid" error occurs? Everything seems to work fine up until the receipt validation step by the RevenueCat SDK.
(As noted above, I did, indeed, upload the public certificate to RevenueCat.)
Does RevenueCat not support Xcode's local StoreKit testing of Mac Catalyst apps (or at least the receipt validation part of it)? Or is there some other explanation of the "receipt is not valid" error above? Thanks for any info you have.