reactjsreact-nativein-app-purchasepaymentreact-native-iap

Getting an empty Array of Products in React native Iap


Hey I am using React native iap with react native 0.64.2. Also I am using razor pay in it also.

"react": "17.0.1",
"react-native": "0.64.2",
"react-native-iap": "7.5.1",
"react-native-razorpay": "^2.3.0",




const itemSkus = Platform.select({
    ios:["com.app.plandetailed"]
  });
const products = await RNIap.getProducts(itemSkus);
console.log('Products', products);

As the products console is empty and I added itemSkus as well. But it tried with "react-native":"0.65.1" "react-native-iap": "12.10.5"

but nothing worked my products statusenter image description here

let me know if anybody have an idea of it. Thanks in advance


Solution

  • You need to call function with skus. here is example:

    let products = await getProducts({skus: [yourSKU]})
    

    It works fine with me.