Skip to content

[iOS] purchaseStream returns outdated purchases even after clearing account + appAccountToken stays the same #169744

Open
@dimad2602

Description

@dimad2602

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: in_app_purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions