在React Native Iap中获取一个空的产品数组。

huangapple go评论78阅读模式
英文:

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在React Native Iap中获取一个空的产品数组。

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.

huangapple
  • 本文由 发表于 2023年6月1日 20:04:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76381669.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定