reactjs - RNIap.getProducts(itemSku) 返回空数组
问题描述
我正在使用这个包react-native-admob
我创建了我的应用程序的 alpha 轨道,并在播放控制台上创建了一个托管产品
如果我尝试
RNIap.prepare()
我得到错误
RNIap.prepare is not a function. (In 'RNIap.prepare()', 'RNIap.prepare' is undefined)
如果我尝试
const itemSkus = Platform.select({
ios: [
my_product_id
],
android: [
my_product_id
]
});
const products = await RNIap.getProducts(itemSkus);
console.log(products)
我明白了
Array []
我缺少任何其他设置吗?这是我第一次在 react-native 上使用应用内购买
我一直在学习本教程,但是当我开始学习时遇到了问题RNIap.prepare()
。我的应用程序使用的是 Expo 管理的工作流程,现在使用的是裸工作流程。我仍在使用 expo start 运行我的应用程序,因为我不知道我还能做些什么来运行它。
解决方案
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
推荐阅读
- ios - 使用 MPVolumeView 时出现(预期声明)错误
- python - 有没有办法在python中将列表中的所有值单独声明为列表
- php - 在 preg_match() 中存在或放置值
- excel - 将具有更改行数的 Excel 表格链接到 PowerPoint 幻灯片中
- python - 迭代行并加入 python pandas
- continuous-integration - Ci(TravisCI 和 CircleCI)中未安装 Cypress 版本
- plsql - PL/SQL Ttrigger 从具有相同行的 2 个表中选择数据
- jquery - 是否可以在分页点击时启动引导模式
- amazon-web-services - API Gateway + GovCloud + 带有 SSL 证书的自定义域名
- java - doFilter 和 HandlerInterceptorAdapter 可以在单个 spring 应用程序中一起使用吗