Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purchaseUpdateListener triggering multiple times (sandbox, ios, subscription) #2893

Open
RomanKurilovich opened this issue Dec 8, 2024 · 1 comment

Comments

@RomanKurilovich
Copy link

Description

After calling requestSubscription and successfully completing a payment, the purchaseUpdatedListener is triggered twice with a transaction that has the same transactionId but different verificationResultIOS. I decoded verificationResultIOS and found that only the fields deviceVerification, deviceVerificationNonce, and signedDate are different.

I also debugged the native part of the code and discovered that:

  1. The first call to purchaseUpdatedListener is triggered by the native method buyProduct, which executes self.sendEvent?("purchase-updated", serialize(transaction, verification)). This directly triggers purchaseUpdatedListener()

  2. The second call to purchaseUpdatedListener is triggered by the native method listenForTransactions, which also executes self.sendEvent?("purchase-updated", serialize(transaction, result)). This directly triggers purchaseUpdatedListener()

Both the first and second calls successfully execute finishTransaction.

Expected Behavior

I expect that for a single purchase, the purchaseUpdatedListener method will be triggered only once.

Environment:

  • react-native-iap: 12.15.7
  • react-native: 0.74.5
  • Platforms: iOS, device, sandbox, storekit 2
@JuGit-pk
Copy link

JuGit-pk commented Dec 11, 2024

Is your issue similar to this?
Issue 1172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants