TypeError: Cannot read property 'canMakePayments' of undefined in IOS
See original GitHub issueVersion of react-native-iap
“react-native-iap”: “1.3.0”,
Platforms you faced the error (IOS or Android or both?)
both
Expected behavior
Must be called on Android before any other purchase flow methods. In ios, it will simply call canMakePayments method and return value.
Actual behavior
TypeError: Cannot read property ‘canMakePayments’ of undefined in IOS
Tested environment (Emulator? Real Device?)
Real Device: Iphone 6, ios 10.3.3
Steps to reproduce the behavior
import * as RNIap from 'react-native-iap';
then:
const itemSkus = Platform.select({
ios: [
'app.xxx.xxx.xxxPurchase'
],
android: [
'xxx
]
});
in component class:
async componentDidMount() {
try {
await prepare();
} catch(err) {
console.warn(err); // standardized err.code and err.message available
}
}
and once i get into this screen appears error that “TypeError: Cannot read property ‘canMakePayments’ of undefined in IOS”
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
"Cannot ready property 'container' of null" when using musicKit
Solution: In chrome at least, musicKit.js requires that the site being hosted is using SSL. This was not a problem for me running...
Read more >TypeError: 'Arguments', 'callee' and 'caller' cannot be ...
I am trying to make a payment request while passing all required fields, but it throws a type error. I want to create...
Read more >PaymentRequest.canMakePayment() - Web APIs | MDN
A Promise to a boolean value that resolves to true if the user agent supports any of the payment methods supplied when instantiating...
Read more >react-native-apple-pay - Bountysource
... this warning message "TypeError: Cannot read property 'createPaymentRequest' of undefined" And I cannot use the show method, this happens me only in...
Read more >dooboolab/react-native-iap (Raised $40.00) - Issuehunt
Types: type on Subscription different on iOS: "Do not use this. ... [RNIAP - 3.5.1]Cannot read property 'getItemsByType' of undefined when using ...
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
@bigchamp Could you update our module (currently it’s version in 1.3.5) and try to unlink and link again? It is because
react-native-iap
isn’t linked properly to your project.reinstall the package and relinking solved my issue 😄