"react-native-iap": "1.3.0",
both
Must be called on Android before any other purchase flow methods. In ios, it will simply call canMakePayments method and return value.
TypeError: Cannot read property 'canMakePayments' of undefined in IOS
Real Device: Iphone 6, ios 10.3.3
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!
@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.
i am facing exact same issue, the version i've installed was 1.3.5 (tried on emulator)
@louiskhenghao Did you tried example project?
Had the same issue, relinking solved it.
Yeah. It should be the linking issue. The linking is not perfect in react-native. You should go over manual linking when not working as expected.
reinstall the package and relinking solved my issue :D
Most helpful comment
@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-iapisn't linked properly to your project.