Replies: 1 comment
-
Have you tried the IapExample app part of this repo? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I switched to using react-native-iap hooks, but when I call requestPurchase({sku: 'validSku'}) the request does not proceed to either the 'then' or the 'catch', and the apple confirm purchase dialog does not appear. I have followed the hooks walkthrough, and went through every piece of documentation/issue/discussion I can find, to no avail. I provided the withIapContext at the app-level. Within the same component where I am experiencing the issue, I am successfully calling getProducts(...) and getSubscriptions(...) in a useEffect() that executes when the component mounts. I have also confirmed that connected === true immediately before requestPurchase, and that the value provided as a parameter to requestPurchase is as expected. I previously had all in-app purchases and subscriptions functioning completely, including backend receipt validation, so it doesn't seems as though there was in issue setting up the products on the apple side. In fact, when I provide an invalid sku to requestPurchase(), I receive an error, so it seems it is doing something.
Expected Behavior
When requestPurchase({sku: 'validSku'}) is called, the call resolves and the Apple purchase dialog appears.
Code Snippets
From App.js
From PurchaseView.js
Environment:
- iPhone 14 (iOS version 16.0.3)
- Xcode simulator (I know I shouldn't use this for testing, but it used to at least display the apple purchase dialog)
To Reproduce
Steps to reproduce the behavior:
Additional Context
Any help would be greatly appreciated! This issue is currently blocking the release of my App :(
Beta Was this translation helpful? Give feedback.
All reactions