Description
Hi, I'm facing two possibly related issues using in_app_purchase on iOS (Sandbox environment). This affects our production logic that relies on transaction tokens.
Issue 1: purchaseStream returns old purchase, even after clearing purchases
After calling buyNonConsumable() with a new product ID purchaseStream still returns the previous purchase.
This happens even after clearing all purchases from the Sandbox test account settings.
log example (invoiceToken for applicationUserName)
flutter: invoiceToken = 1f0b8c5b-a736-4d6b-9f87-02652b87632b
flutter: productDetails.id = com.kryonvpn.annual
flutter: buyNonConsumable
flutter: Purchase stream update: com.kryonvpn.6months
flutter: Purchase completed: com.kryonvpn.6months
flutter: invoiceToken = a5182144-a4ba-4f3e-9b8a-b193072bcea0
flutter: productDetails.id = com.kryonvpn.monthly
flutter: buyNonConsumable
flutter: Purchase stream update: com.kryonvpn.6months
flutter: Purchase completed: com.kryonvpn.6months
Expected
Each call to buyNonConsumable() should result in a fresh purchase returned by the stream.
Issue 2: appAccountToken / appTransactionId remains the same across multiple distinct purchases
On the server, even when a new appAccountToken is passed from the client for each purchase (UUID), Apple keeps returning the same appTransactionId.
This breaks our backend logic which relies on this being a unique transaction identifier.
{"time":"2025-05-28T05:31:11Z","msg":"Apple transaction payload","payload":{"appAccountToken":"2d5a0880-f68e-44a7-a414-f51204e63904","appTransactionId":"704464472748013865","productId":"com.kryonvpn.monthly","transactionId":"2000000928154716"}}
{"time":"2025-05-28T09:35:11Z","msg":"Apple transaction payload","payload":{"appAccountToken":"2d5a0880-f68e-44a7-a414-f51204e63904","appTransactionId":"704464472748013865","productId":"com.kryonvpn.monthly","transactionId":"2000000928429780"}}
Environment
in_app_purchase 3.2.3
iOS Sandbox account
Purchase method: buyNonConsumable()
Each purchase uses a unique applicationUserName / appAccountToken (UUID)
Thanks for your help!