Skip to content

[Android] getAvailablePurchases doesn't return failed purchase #2956

@luongminh2410-fabbi

Description

@luongminh2410-fabbi

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description
I want to use getAvailablePurchases to restore purchases on Android.

However, I’ve encountered two issues depending on the state of the purchase:

  • If the Google Play payment process is interrupted before the green checkmark (successful purchase) is shown in the popup (purchase was created and i can check it on play store)
    → getAvailablePurchases does not return any data related to the pending/failed purchase.

  • If the payment is marked as successful in the popup (green checkmark), but then an error occurs afterward
    → getAvailablePurchases does return the data for this failed purchase.

Expected Behavior

getAvailablePurchases return pending/failed purchase

Screenshots

Image

Environment:

  • react-native-iap: 12.15.1
  • react-native: 0.70.6
  • Platforms (iOS, Android, emulator, simulator, device): Android

To Reproduce
Steps to reproduce the behavior:

  1. Request subscription
  2. Select a payment method
  3. While the purchase is being processed, turn on airplane mode before the green success checkmark appears.
  4. After a few seconds, the Google Play popup shows “Purchase failed.”
  5. Reopen the app and call getAvailablePurchases → doesn't returns failed purchase in array.

[Optional] Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓ questionFurther information is requested🤖 androidRelated to android

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions