Skip to content

ios: onPurchaseSuccess triggered multiple times for a single purchase #152

@SethArchambault

Description

@SethArchambault

We just went live with an upgrade to react-native-iap version 14.7.20, and we've stated seeing that onPurchaseHandler is getting triggered multiple times for ios. Users seem to be paying and getting accounts correctly, but this means that our server is often getting with upwards of 10 verification requests for the same account (different apple transaction ids every time). They all land at the same time, so 10 accounts get created for the same user.

My current guess is that this could be happening for users with old storekit 1 transactions, which under the new system are found and resubmitted?

I will try to fix this in our app by having onPurchaseHandler add incoming purchases into a queue, and then we'll just run through that queue one at a time until something is successful, and then clear the queue to avoid any duplicates.

This is really unexpected, and it only seems to happen on ios - Android seems to be working fine.

Any idea if there are any simpler solutions to make sure onPurchaseSuccess only fires once?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions