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

Android finishTransaction on Downgrade Flow doesn't complete after 12.3.1 #2686

Open
ahlbet opened this issue Feb 15, 2024 · 4 comments
Open

Comments

@ahlbet
Copy link

ahlbet commented Feb 15, 2024

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: 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:

  1. Subscribe to a product
  2. Attempt to downgrade to a cheaper product/subscription
  3. finishTransaction will not complete

@dongminlim
Copy link

dongminlim commented Feb 21, 2024

me too finishTransaction not called android 12.12.1

@yedi97
Copy link

yedi97 commented Mar 1, 2024

For android you should use acknowledgePurchaseAndroid, but I recommend handle on server side, here is the documentation about acknowledge for server side:

@mikemangas
Copy link

@yedi97 what is the function of "acknowledgepurchaseandroid"?
To confirm to google, that indeed the user has now "subscribed" for example - as a confirmation?

@yedi97
Copy link

yedi97 commented Mar 20, 2024

@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

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

4 participants