2

react-native-hms-iap在我的 react native 项目中实现了。我配置了这里提到的所有细节。此外,我可以确保没有签名问题,因为react-native-hms-account login with huawei id在我的应用程序中运行良好。

我已经在Product Management. 在此处输入图像描述

但是这个订阅产品并没有反映在我的 react native 应用程序中。我越来越空了AvailableProductList

[Fri Sep 24 2021 18:22:25.188]  LOG      isEnvReady:Success
[Fri Sep 24 2021 18:22:27.192]  LOG      PurchasedRecordListView :: []
[Fri Sep 24 2021 18:22:27.323]  LOG      obtainOwnedPurchases success:: []
[Fri Sep 24 2021 18:22:27.568]  LOG      obtainOwnedPurchases success:: []
[Fri Sep 24 2021 18:22:27.572]  LOG      PurchasedRecordListView :: []
[Fri Sep 24 2021 18:22:27.652]  LOG      AvailableProductList :: {"status":{"hashCode":(hashcode),"describeContents":0,"isCanceled":false,"hasResolution":false,"isSuccess":true,"statusMessage":"success","isInterrupted":false,"statusCode":0,"errorString":"success"},"productInfoList":[],"errMsg":"success","returnCode":0}
[Fri Sep 24 2021 18:22:27.738]  LOG      AvailableProductList :: {"status":{"hashCode":(hashcode),"describeContents":0,"isCanceled":false,"hasResolution":false,"isSuccess":true,"statusMessage":"success","isInterrupted":false,"statusCode":0,"errorString":"success"},"productInfoList":[],"errMsg":"success","returnCode":0}
[Fri Sep 24 2021 18:22:27.804]  LOG      obtainOwnedPurchases success:: []
[Fri Sep 24 2021 18:22:27.855]  LOG      AvailableProductList :: {"status":{"hashCode":(hashcode),"describeContents":0,"isCanceled":false,"hasResolution":false,"isSuccess":true,"statusMessage":"success","isInterrupted":false,"statusCode":0,"errorString":"success"},"productInfoList":[],"errMsg":"success","returnCode":0}
[Fri Sep 24 2021 18:22:27.859]  LOG      PurchasedRecordListView :: []

在此处输入图像描述

可用产品列表为空的原因是什么?是否有一段时间我应该等待以反映可用的产品?

我是否应该专门为 IAP 定义任何签名,而不是为 Account ID 定义的签名?

谢谢你。

4

1 回答 1

1

好的,我已经弄清楚了这个案子。那完全是我的错误。我忘记将产品 sku 传递给HMSIapModule.obtainOwnedPurchases()方法。在我通过产品 sku 后,它运行良好。

于 2021-09-24T14:31:47.633 回答