react-native-iap
react-native-iap copied to clipboard
finishTransaction not clearing previous purchase after successful purchase
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:
- Purchase a subscription and finish the transaction
- Logout and/or reinstall the app
- Try to subscribe again
Try await RNIap.finishTransaction({purchase: purchase}); I used to call it like this await RNIap.finishTransaction(purchase); and it kept throwing me an error.
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 emptyEnvironment:
- 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:
- Purchase a subscription and finish the transaction
- Logout and/or reinstall the app
- Try to subscribe again
I am also facing this issue in sandbox environment, any solutions ?
same issue here, currentPurchase/currentPurchaseError is only cleared if I restart the app.