dooboolab-community / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.dooboolab.com
MIT License
2.74k stars 633 forks source link

finishTransaction not clearing previous purchase after successful purchase #2590

Open davidteejay opened 8 months ago

davidteejay commented 8 months ago

Description

After a successful purchase (in the sandbox environment), and trying to make another subscription, currentPurchase from the useIAP() hook still contains the previous transaction information, even after restarting or reinstalling the app.

Expected Behavior currentPurchase should be empty

Environment:

To Reproduce Steps to reproduce the behavior:

  1. Purchase a subscription and finish the transaction
  2. Logout and/or reinstall the app
  3. Try to subscribe again
obrad97 commented 8 months ago

Try await RNIap.finishTransaction({purchase: purchase}); I used to call it like this await RNIap.finishTransaction(purchase); and it kept throwing me an error.

Janak-Nirmal commented 5 months ago

Description

After a successful purchase (in the sandbox environment), and trying to make another subscription, currentPurchase from the useIAP() hook still contains the previous transaction information, even after restarting or reinstalling the app.

Expected Behavior currentPurchase should be empty

Environment:

  • react-native-iap: 12.10.7
  • react-native: 0.68.1
  • Platforms (iOS, Android, emulator, simulator, device): iOS, real device

To Reproduce Steps to reproduce the behavior:

  1. Purchase a subscription and finish the transaction
  2. Logout and/or reinstall the app
  3. Try to subscribe again

I am also facing this issue in sandbox environment, any solutions ?

wscld commented 4 months ago

same issue here, currentPurchase/currentPurchaseError is only cleared if I restart the app.