React native react本机iap getProducts返回空数组
我正在使用应用程序内购买。但是React native react本机iap getProducts返回空数组,react-native,React Native,我正在使用应用程序内购买。但是getProducts方法返回空数组。下面是我为此所做的 在AndroidManifest.xmllike中插入计费权限 将此android应用程序AAB上载到alpha版本,但未发布 创建id为productid1和productid2的产品productid1是活动的apk和productid2是非活动的 制作以下代码 import*作为来自“react native iap”的RNIap; const itemSkus=Platform.select({
getProducts
方法返回空数组。下面是我为此所做的
AndroidManifest.xml
like中插入计费权限
productid1
和productid2
的产品productid1
是活动的apk和productid2
是非活动的import*作为来自“react native iap”的RNIap;
const itemSkus=Platform.select({
ios:['productid1'、'productid2'],
安卓:['productid1','productid2'],
});
...
componentDidMount(){
RNIap.initConnection().then(conn=>{
//康涅狄格是真的
RNIap.getProducts(项目SKU)
。然后(res=>{
//res是[]
})
.catch(错误=>{
//没有错
});
});
}
...
正如hyochan在2018年5月4日发表的评论,我是否应该等待产品更新?或者我的代码有问题吗?还是别的什么
我的环境是
- 反应本机:“0.60.5”
- 反应本机iap:“^4.3.3”
pod'RNIap',:path=>'../node\u modules/react native iap'
复制并粘贴到pod文件中,然后将cd iOS&&pod install&&cd..(从应用程序目录运行终端命令)。
我有这个问题,结果我跳过了这些非常重要的步骤 你什么时候添加的产品?@GauravRoy我在2~3个小时前添加了产品。等到明天,如果仍然没有。然后再检查一遍,因为现在是圣诞节,可能需要time@GauravRoy那么,有没有办法检查产品是否注册?还是等着呢?对我来说,一次花了一个小时,另一次花了一天