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

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

Getting an empty Array of Products in React native Iap

问题

抱歉,我只能翻译代码部分,以下是翻译的内容:

  1. 我正在使用 React Native iap版本为 react native 0.64.2同时也在其中使用了 Razorpay
  2. "react": "17.0.1",
  3. "react-native": "0.64.2",
  4. "react-native-iap": "7.5.1",
  5. "react-native-razorpay": "^2.3.0",
  6. const itemSkus = Platform.select({
  7. ios:["com.app.plandetailed"]
  8. });
  9. const products = await RNIap.getProducts(itemSkus);
  10. console.log('Products', products);
  11. 由于产品控制台为空我也添加了 itemSkus但我尝试了以下版本
  12. "react-native": "0.65.1",
  13. "react-native-iap": "12.10.5"
  14. 但仍然没有效果我的产品状态如下所示
  15. [![进入图片说明文字][1]][1]
  16. [1]: https://i.stack.imgur.com/9Hyt5.png
  17. 如果有人有任何想法请告诉我提前谢谢
英文:

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

  1. "react": "17.0.1",
  2. "react-native": "0.64.2",
  3. "react-native-iap": "7.5.1",
  4. "react-native-razorpay": "^2.3.0",
  5. const itemSkus = Platform.select({
  6. ios:["com.app.plandetailed"]
  7. });
  8. const products = await RNIap.getProducts(itemSkus);
  9. 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 调用函数。
这是一个例子:

  1. 用法示例:let products = await getProducts({skus: [yourSKU]})

对我来说这很有效。

英文:

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

  1. 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:

确定