I’m using StoreKit 2 with an automatically synced StoreKit Configuration file in Xcode which is an amazing tool to use in development. Unfortunately, even though I uploaded the public certificate for StoreKit testing, I always get the “ERROR: The receipt is not valid.” message during development.
I’ve read in other threads that this is a common issue. Also, I’ve read somewhere to use StoreKit 1 or to not provide a StoreKit configuration file. But I’m not willing to use older APIs and features when there are shiny new tools that make development much more fun. Please don’t try to convince me that StoreKit 1 is more stable. I’ve used StoreKit 2 directly, and it was an awesome development experience. I’m just using RevenueCat for the Live Data, Experiments, and for the Paywall UI. But my development experience has degraded since I made the switch.
To improve this, I would like to simply turn off receipt validation when I run my app in DEBUG mode. In other words, I’m looking for something like the following code to work in the Swift SDK:
```Swift
#if DEBUG
Purchases.receiptValidationEnabled = false
#endif
```
If you want to enforce receipt validation in production for some reason, you could instead name the option something like `disableReceiptValidationInDebugMode` and do the DEBUG check yourself internally within the SDK. Alternatively, I would be also fine to turn off receipt validation in sandbox mode for all my apps or with an app-specific setting.
All I want is a reliable and smooth development experience where I can use Xcodes awesome built-in StoreKit transactions manager and the fact that I can make purchases quickly without having to sign in to any Sandbox account (which I no longer need with StoreKit config files). I don’t like to get errors during development because of some security measures.