Validating Mac App Store purchase with StoreKit

For years I've been using Receigen for receipt verification for the Mac App Store build of my application. However, with the deprecation of exit code 173, I am moving to StoreKit-based verification and have a couple of questions.

I have followed the instructions from https://developer.apple.com/documentation/storekit/apptransaction/shared and have something like this (simplified):

Swift:

@objc class ValidateReceipt: NSObject {
	@objc func validate() async -> Bool {
		do {
			let verificationResult = try await AppTransaction.shared
			
			switch verificationResult {
				case .verified(_ /*let appTransaction*/):
					// StoreKit verified that the user purchased this app and
					// the properties in the AppTransaction instance
					return true;
					
				default:
					// The app transaction didn't pass StoreKit's verification
					return false;
			}
		}
		catch {
			// Handle errors
			return false;
		}
	}
}

Objective-C:

		ValidateReceipt *validateReceipt = [[ValidateReceipt alloc] init];
		[validateReceipt validateWithCompletionHandler:^(BOOL result) {
			if (result)
			{
				// Successful app purchase validation
			}
			else
			{
				// App purchase validation failure
			}
		}];

Thing is, I always get a valid result, i.e., in ValidReceipt.validate(), the case .verified block always runs. Even when exporting a new release build of my app and running it (without any _MASReceipt).

When using exit code 173, an .app without a _MASReceipt would prompt for app store login. Nothing of the sort happens now.

Am I misunderstanding the documentation / doing something wrong / missing something obvious?

I'm in the same boat, but a couple of days behind you.

From what I understand, you don't get a receipt during development anymore. See this post.

I've seen many posts about problems with StoreKit2. Most people seem to just switch to StoreKit1. However, it can be difficult to learn anything from the internet anymore. I should know more in a few days.

Validating Mac App Store purchase with StoreKit
 
 
Q