IapHub.buy() doesn't return anything
See original GitHub issueWhen I try to use the buy()
method it doesn’t do anything after the purchase is done, blocking me from doing anything after it. It seems as if the promise is never finished, the code never reaches console.log(transaction)
or finally {}
. This used to work a couple of days ago. I do see they receipt in the IAPHUB dashboard though.
try {
const transaction = await IapHub.buy('product_sku')
console.log(transaction)
} catch (err) {
console.log(err)
} finally {
console.log('finally done')
}
I also see this in the Xcode logs:
Purchase Started !!
2020-07-23 00:09:26.745113-0400 Development[1039:184402]
Purchase Successful !!
.
So the purchase is successful.
react-native-iaphub v3.0.9 react-native-iap v4.4.3 react-native v0.63.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
react-native-iaphub/README.md at master - GitHub
The easiest way to implement IAP (In-app purchase) in your React Native app. - react-native-iaphub/README.md at master ...
Read more >Blog | IAPHUB
The react-native-iaphub is already doing that pretty well but we've decided to ... and doesn't return subscriptions on a paused or retry period...
Read more >react-native-iaphub - npm
This method will only return the transactions that were not already on IAPHUB (pretty handy to know how many transactions have been restored)....
Read more >Reasons for SKProductsRequest returning 0 products?
In the sandbox I had everything working, there was no indication that there was anything anything wrong, even with an optimized release build....
Read more >React Native : Subscriptions, In-App Purchases & Service ...
If for debugging you want to consume all items, you have to iterate over the purchases returned by getAvailablePurchases() . Beware that if...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We pushed a PR to fix the issue in react-native-iap (here) 🙂 The issue should be fixed in the latest version of react-native-iaphub we released (v4.1.0), if it doesn’t work be sure you have the latest version of react-native-iap (v4.5.2).
Hi @scipilot,
We’ve seen iOS bugs (not because of the IAPHUB library) like this one in the sandbox environment (not happening in production), especially on older versions of iOS. If it happens you should either try to restart the device or create a new sandbox iTunes account. But it seems like you were able to resolve the issue 🙂