Version : 2.1.1
iOS
Invalid Product ID.
Error : Invalid Product ID.
Emulator and Real Device
When I call buyProduct function it is return to me Invalid Product ID.
My In-App Purchase Reference is Ready to Submit but I don't understand why it is not working?
I read all solution suggestions and I tried all of them but still my app not working.
Also I tried another react-native-iap versions (latest, 2.1.0) nothing has changed.
What can I do?
Please review #256 issue and check what you've missed first.
@dooboolab thank you for answer. My problem fixed like this.
RNIap.getProducts(['yourProductId']).then(success => {
let product = success[0];
RNIap.buyProduct(product.productId).then(ok => {
}).catch(error => {
alert(error);
})
}).catch(error => {
alert(error);
})
@selcukitmis It works.
@selcukitmis is there a reason that you use the productId from the product object rather than 'yourProductId'?
@noahhayes of course. when I use RNIap.getProducts I don't know my product details yet.
RNIap.getProducts is promise. I taking first product in "THEN" section.
May be you need second product about that you have to check code on your project
Most helpful comment
@dooboolab thank you for answer. My problem fixed like this.
RNIap.getProducts(['yourProductId']).then(success => { let product = success[0]; RNIap.buyProduct(product.productId).then(ok => { }).catch(error => { alert(error); }) }).catch(error => { alert(error); })