Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Repeatedly prompted for the purchase in react-native-iap IOS. No callback on the listener #2654

Closed
aabhiitatva opened this issue Dec 27, 2023 · 3 comments

Comments

@aabhiitatva
Copy link

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

Description
I am facing an issue while integrating react-native-iap on iOS. I am able to fetch the products I created on app store connect.
The purchase popup appears after clicking on the purchase button and entering my Apple credentials. However, after a successful payment, there is no callback on the listener. After that, I'm repeatedly prompted for the purchase, regardless of how many times I enter my password. And if I cancel the payment, I get a proper response on my currentPurchaseError state.

Expected Behavior
For purchase to complete (either fail or pass). And receive a callback from the listener. If not at least it should not prompt for payment again.

Screenshots

1 2 3

Environment:

  • "react": "17.0.2"
  • "react-native": "0.66.5"
  • "react-native-iap": "^12.12.1"
  • Platforms (iOS, simulator, device):

To Reproduce
Below is the code for my PurchaseScreenIOS screen

4
5
6

I have selected for In-App Purchase in Xcode and created products on apple app store connect.


[Optional] Additional Context

@aabhiitatva
Copy link
Author

Steps to resolve.

  1. use a physical device for testing
  2. requestPurchase({sku: id})
    .then(async data => {
    console.log("Purchase was completed");
    })
    .catch(err => {
    console.log("Purchase was not completed");
    });
  3. No need for listeners
  4. Use "react-native-iap": "^12.10.7"

@GaNiziolek
Copy link

Hello @aabhiitatva, I have the same issue here, but I don't have access to a physical device, only an emulator.

Do you know if this issue is strictly related to the emulator? I've followed the steps you describe to resolve but the problem persists.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants