react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

finishTransaction not clearing previous purchase after successful purchase

Open davidteejay opened this issue 8 months ago • 3 comments

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

davidteejay avatar Oct 22 '23 13:10 davidteejay

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

obrad97 avatar Nov 01 '23 18:11 obrad97

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 ?

Janak-Nirmal avatar Jan 24 '24 12:01 Janak-Nirmal

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

wscld avatar Mar 04 '24 15:03 wscld