Sandbox subscription test is triggering multiple transaction events for a single purchase attempt

Hello,

We are currently testing subscription purchases in the Sandbox environment, and we are seeing an issue that we do not fully understand.

When we attempt a single subscription purchase, multiple purchase signals or transaction events are sometimes delivered from Sandbox for what appears to be just one payment attempt. In some cases this happens twice, and in other cases we have seen it occur as many as five to seven times. The number is inconsistent each time, and we have not been able to identify any clear pattern.

At this point, we are not sure whether this is a known instability or limitation of the Sandbox testing environment, or whether there may be something incorrect in our own implementation or configuration.

Has anyone experienced similar behavior when testing auto-renewable subscriptions in Sandbox? If so, we would really appreciate any guidance on what to check.

Thank you.

It's hard to say even a word since you don't show a single line of code. We don't know whether you are using UIKit or SwiftUI, showing a list of subscription plans with UITableView, UICollectionView or SwiftUI List or SwiftUI Table. There is zero information.

Thank you for your reply, and I apologize for not providing enough detail earlier.

Our app is built with React Native, and we implemented in-app purchases using an OpenIAP-related library that supports StoreKit 2. We are currently testing with a Sandbox account.

The feature itself is not completely broken, but we are seeing several abnormal behaviors during testing. For example, even when a purchase is attempted only once, we sometimes receive the purchase-completed message two or three times. We have also observed other inconsistent behaviors during Sandbox testing.

Because of this, we were wondering whether this might be related to instability or known issues in the Sandbox environment, rather than being entirely caused by our implementation.

Has anyone experienced similar issues when testing subscriptions with StoreKit 2 in a React Native environment? If there are any known Sandbox limitations or specific points we should check first, I would greatly appreciate your advice.

Oof, good luck with ReactNative. I haven't used any IAP ReactNative library, so I'll speak in terms of native StoreKit.

On a somewhat relieving note, I also have this issue in my Swift-native iOS app, and I made a post about it on the forums, too. It happens both in Sandbox and production, but NOT when using Local StoreKit Testing configuration files.

There are multiple ways for you to observe StoreKit updates. You can observe transactions with Transaction.updates, and also just the subscription updates themselves with SubscriptionStatus.updates. Technically, these are different, but of course a new transaction means potential for a subscription status update.

Basically, I had to implement logic to de-duplicate subscription updates that were redundant.

For every Subscription update I get, I map it to an array for what I see as "active" subscriptions.

The rest of my app will watch for if my array of "active" subscriptions changes. If it changes, then we will enabled/disable features. Duplicate transactions / updates should have no effect on my array and therefore no effect on the rest of my app.

This is similar to Apple's SKDemo, which I highly suggest you look through carefully to get an idea of what I'm talking about.

Sandbox subscription test is triggering multiple transaction events for a single purchase attempt
 
 
Q