英文:
Getting an empty Array of Products in React native Iap
问题
抱歉,我只能翻译代码部分,以下是翻译的内容:
嘿,我正在使用 React Native iap,版本为 react native 0.64.2。同时也在其中使用了 Razorpay。
"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);
由于产品控制台为空,我也添加了 itemSkus。但我尝试了以下版本:
"react-native": "0.65.1",
"react-native-iap": "12.10.5"
但仍然没有效果,我的产品状态如下所示:
[![进入图片说明文字][1]][1]
[1]: https://i.stack.imgur.com/9Hyt5.png
如果有人有任何想法,请告诉我。提前谢谢!
英文:
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 status
let me know if anybody have an idea of it. Thanks in advance
答案1
得分: 1
你需要使用 SKU 调用函数。
这是一个例子:
用法示例:let products = await getProducts({skus: [yourSKU]})
对我来说这很有效。
英文:
You need to call function with skus.
here is example:
let products = await getProducts({skus: [yourSKU]})
It works fine with me.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论