RNIap.prepare : canMakePayments is not a function
See original GitHub issueVersion of react-native-iap : 1.3.6
Platforms you faced the error (IOS or Android or both?) : iOS 11.4.1
Expected behavior : no error expected
Actual behavior
RNIap.prepare sometimes throws an error : RNIap.prepare error : TypeError: a.canMakePayments is not a function. (In ‘a.canMakePayments()’, ‘a.canMakePayments’ is undefined)
Tested environment : real device iPhone6s
Steps to reproduce the behavior
try {
await RNIap.prepare();
}
catch (error) {
console.log("RNIap.prepare error : ", error);
}
Link Library seems to be set accordindly to documentation :
As it is something I track in Sentry, I don’t have the full context of use on client side, it is possible it happens when the user hit the cancel button when asked for his AppStore credentials or when you are in a Sandbox mode .I need to dig more into this, to give more context and reproducible behavior.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
RNIap.prepare : canMakePayments is not a function | Gitcoin
Version of react-native-iap : 1.3.6 ### Platforms you faced the error (IOS or Android or both?) : iOS 11.4.1 ### Expected behavior :...
Read more >React Native Android In App Purchase Error - Stack Overflow
On android Only - you need to open a connection to the billing service. This used to be RNIAP.prepare() , but it is...
Read more >react-native-iap - npm
In ios, it will simply call canMakePayments method and return value. ... Next, call the prepare function (ios it's not needed, ...
Read more >canMakePayments vs. ApplePaySession - Apple Developer
Hello, guys! As far as I understood, there is no difference between ApplePaySession.canMakePayments and window.ApplePaySession checking, right?
Read more >How to use the react-native-iap.buySubscription function in ...
export async function showPayment(planId, callback) { try { await RNIap.prepare(); await RNIap.getSubscriptions([planId]); const purchase = await RNIap.
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
Closing this since it seems
linking
issue inreact-native
.@dooboolab ok I should have stated that the module was already published with the correct current version that has canMakePayments method. Even the previous build already had the last version of react-native-iap. Of course if there is an update in react-native modules such as react-native-iap, you have to resubmit a build of the app. The current build of the app has the current version of react-native-iap. The iOS app used for the test is this latest build (all this is tracked on Sentry so I’m 100% sure).