RNIap.requestPurchase have no resolved promise result on iOS 14.0 version
See original GitHub issueVersion of react-native-iap
4.4.8, 4.5.0
Version of react-native
0.61.5
Platforms you faced the error (IOS or Android or both?)
IOS (14.0)
Expected behavior
requestSubscription and requestPurchase methods should resolve promise on sucessful purchase.
Actual behavior
purchaseUpdatedListener
receives the result of successful purchase but RNIap.requestPurchase(sku, false)
and RNIap.requestSubscription(sku, false)
have no resolved promise result. Actually there is no success callback execution. It works fine in previous ios versions and in android.
Tested environment (Emulator? Real Device?)
both
Steps to reproduce the behavior
- Set up purchases.
- Get real device with ios 14.0 or emulator with working StoreKit
- Try to get console.log from successful purchase:
RNIap.requestPurchase(sku, false).then(result => {console.log('result', result)});
//or
RNIap.requestSubscription(sku, false).then(result => {console.log('result', result)});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
react-native-iap - npm
This react-native module will help you access the In-app purchases capabilities of your phone on the Android , iOS platforms and the Amazon ......
Read more >Using .then(), .catch(), .finally() to Handle Errors in Javascript ...
Once a Promise has been settled (rejected or resolved) it cannot be re-settled; this immutability is important. This came in handy recently when...
Read more >Implementing Promises in Swift - Pierre Felgines
We will implement resolve in a moment, when all the errors will be taken care of. The next one is simple, the method...
Read more >React Native scene doesn't update from Parse promise
All I'm doing is passing a navigator object a new route. "Login successful" and "Navigate function called" are both outputted to the console,...
Read more >How to Handle Promises in React - Upmostly
To work these into the React lifecycle, we can use the useState hook to store the result of the promise when it is...
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 Free
Top 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
Just submitted a pull request to fix the issue. As soon as it is accepted, we will update react-native-iaphub to the latest version of react-native-iap with the fix 👍
Fixed in
4.5.2
.