React-native-iap: Error : Invalid Product ID.

Created on 20 Sep 2018  ·  5Comments  ·  Source: dooboolab/react-native-iap

Version of react-native-iap

Version : 2.1.1

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

Invalid Product ID.

Actual behavior

Error : Invalid Product ID.

Tested environment (Emulator? Real Device?)

Emulator and Real Device

Steps to reproduce the behavior

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?

📱 iOS 🙏 help wanted

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); })

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings