In-app purchase fails on Apple Silicon Mac

I'm testing IPhone and iPad Apps on Apple Silicon Macs.

When I purchase In-app product in the app on Apple Silicon Mac, the payment receipt is not created, so the purchase fails.

In console log, it says it doesn't have permission to write to the file.

storekitagent  [6913DE38_SK1] Error writing receipt (5095 bytes) to file:///Users/XXXX/Library/Containers/90FE2A60-9FDF-4ECF-848F-CE3D396322CA/Data/StoreKit/sandboxReceipt: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “sandboxReceipt” in the folder “StoreKit”" UserInfo={NSFilePath=/Users/XXXX/Library/Containers/90FE2A60-9FDF-4ECF-848F-CE3D396322CA/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x14202c920 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

The App is using Original API for In-App Purchase written in Objective-C. When I purchase in-app product, the app calls SKPaymentQueue::addPayment. And then it gets paymentQueue:updatedTransactions callback with SKPaymentTransactionStatePurchased. This means that the payment was successful. But the receipt is not created so I can't continue the after process.

I'm testing with sandbox in-app purchase. I have tested several times and confirmed that on macOS Monterey 12.2 the receipt is created successfully, but on macOS Ventura 13.2 the receipt isn't created. I think there is something to do with macOS version.

Does anyone have any solutions?

Here is a very similar thread on apple developer forum. (And there too has no anwsers)  https://developer.apple.com/forums/thread/719505

Hello! Could you please create a ticket via https://feedbackassistant.apple.com/ , attach a sysdiagnose and post FB ticket number here?

posted FB11977889

posted FB11977889

FB11977889 posted

posted FB11977889

I'm still facing the issue (despite earlier comment that it's fixed). macOS is up-to-date (macOS 13.1, 22C65) no system updates are available. I cannot refresh the receipt either. I'm always returned the old receipt from just before I upgraded to Ventura.

<SKReceiptRefreshRequest: 0x600002928360>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=500 "Failed to write receipt to URL: file:///Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt" UserInfo={NSDebugDescription=Failed to write receipt to URL: file:///Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x6000026f2490 {Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “sandboxReceipt” in the folder “StoreKit”." UserInfo={NSFilePath=/Users/jeko/Library/Containers/447F8668-DE02-4E43-8350-6AEED8A3408E/Data/StoreKit/sandboxReceipt, NSUnderlyingError=0x6000026f3720 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}}, AMSServerErrorCode=0}

After removing /.../Data/StoreKit/ as an attempt to fix this manually, the problem remains, no receipt are created, I get a similar error.

same here

In-app purchase fails on Apple Silicon Mac
 
 
Q