react-native-iap
react-native-iap copied to clipboard
Android finishTransaction on Downgrade Flow doesn't complete after 12.3.1
Description
On Android and react-native-iap versions 12.3.1 and greater, during a downgrade flow, the method finishTransaction
will not complete. However, on 12.3.0 and previous, this flow will complete successfully and resolve.
Here is the code we're using for finishTransaction:
await RNIap.finishTransaction({
purchase: purchase,
isConsumable: false,
});
During testing, I didn't see any relevant logs or error messages; it appears to fail silently or just simply not resolve completely. Let me know if I can run through it again and look for something I may have missed in JS logs or Android Studio logs.
I haven't read through the entirety RNIapModule.kt but this appears to be the change that causes our issue: https://github.com/dooboolab-community/react-native-iap/compare/12.3.0...12.3.1
Expected Behavior
If an Android user downgrades their subscription and completes the purchase within Google Play pop up, finishTransaction
should resolve successfully.
Environment:
- react-native-iap: 12.3.1
- react-native: 0.71.15
- Platforms (iOS, Android, emulator, simulator, device): Android device
To Reproduce Steps to reproduce the behavior:
- Subscribe to a product
- Attempt to downgrade to a cheaper product/subscription
- finishTransaction will not complete
me too finishTransaction not called android 12.12.1
For android you should use acknowledgePurchaseAndroid
, but I recommend handle on server side, here is the documentation about acknowledge for server side:
- For product: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/acknowledge
- For subscription: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/acknowledge
@yedi97 what is the function of "acknowledgepurchaseandroid"? To confirm to google, that indeed the user has now "subscribed" for example - as a confirmation?
@yedi97 what is the function of "acknowledgepurchaseandroid"? To confirm to google, that indeed the user has now "subscribed" for example - as a confirmation?
Yes, if not call acknowledgePurchaseAndroid
user payment will be refunded after a few days, I remember 3 days