Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RNIap.getProducts(itemSku) returns empty array

I am using the package react-native-admob

I created an alpha track of my app and created a managed product on the play console

If I try

RNIap.prepare()

I get the error

RNIap.prepare is not a function. (In 'RNIap.prepare()', 'RNIap.prepare' is undefined)

if I try

const itemSkus = Platform.select({
  ios: [
    my_product_id
  ],
  android: [
    my_product_id
  ]
});
const products = await RNIap.getProducts(itemSkus);
console.log(products)

I get

Array []

Is there any additional setup I'm missing? This is my first time working with in-app-purchases on react-native


I have been following along with this tutorial, but run into problems when I get to RNIap.prepare(). My app was using the Expo managed workflow, and is now using the bare workflow. I am still running my app with expo start, because I don't know what else I can do to run it.

like image 986
Sam Avatar asked Mar 28 '26 01:03

Sam


2 Answers

Have you followed these steps in the document rn-iap? This was the document which i followed and implemnted in app purchase for both android and ios in react native. It explains easily and beautifully. Do check it out.

ps: Even my app is in production and it has succesfull in app purchase

like image 116
Gaurav Roy Avatar answered Mar 31 '26 05:03

Gaurav Roy


You can't get RNIap.prepare() in android before first release in Google Play Store

like image 21
Shing Ho Tan Avatar answered Mar 31 '26 06:03

Shing Ho Tan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!