I'm implementing iOS subscriptions in a React Native app using react-native-iap. For iOS, we pass a UUID (appAccountToken) generated by our backend to uniquely identify users in App Store Server Notifications (ASSN V2).
In Sandbox testing, everything works as expected:
appAccountToken maps correctly to the user.
I can purchase, cancel, upgrade, and downgrade subscriptions.
Server receives correct notification events with the corresponding user’s token.
However, in TestFlight, I observe confusing behavior:
Scenario:
User A (on TestFlight) signs up and purchases Plan A.
I delete this user’s account permanently from my backend.
On the same device, using the same Apple ID, a new user B signs up.
User B purchases Plan B (a different subscription plan).
Issue:
The appAccountToken in the App Store Server Notification (ASSN V2) for Plan B does not match the new user B. It seems to reference the deleted user A.
Also, the event received is an upgrade/downgrade event instead of SUBSCRIBED (initial purchase), even though it’s a new app account.
Why is Apple treating this as an upgrade/downgrade instead of a new subscription?
Why does the appAccountToken reflect the old (deleted) user and not the newly logged-in one?
Is subscription cancellation not allowed in iOS for testflight testing?
Is this behavior expected in TestFlight due to Apple ID being reused, or am I missing something in implementation?
Is there any way to reset Apple’s linkage or make Apple treat the new app user as distinct (without changing Apple ID)?