Problems when testing Storekit purchases and subscriptions in Xcode and TestFlight

I have an app that unlocks content based on in-app purchases, both one-time payments and subscriptions.

Recently, I added new subscription products, both for distribution in App Store Connect and in the configuration file in XCode to be able to test it, declaring it in the scheme.

Since the beginning of development, I have had issues with subscriptions. Every time I close the app and reopen it, in order for the app to recover which subscription is active, I have to run the purchase function. This doesn’t happen with purchases or in the production environment, where it works fine.

I’ve now implemented SubscriptionStoreView, so I don’t depend on my business logic, in case I’m doing something wrong in the code. This view never remembers which product I’ve already purchased. Currently, in a version deployed to my phone from XCode, it doesn't even process the payment.

On macOS, the experience is even worse. On iPad, through TestFlight, I haven’t even been able to test payments at all.

Problems when testing Storekit purchases and subscriptions in Xcode and TestFlight
 
 
Q