华为 IAP - 产品列表在反应本机 hms iap 中为空
Huawei IAP - product list is empty in react native hms iap
我在我的 React Native 项目中实现了 react-native-hms-iap
。我配置了 here 中提到的所有细节。此外,我可以保证没有签名问题,因为 react-native-hms-account
login with huawei id
在我的应用程序中运行良好。
我已经在 Product Management
中配置了 'subscription' 产品。
但是这个订阅产品并没有反映在我的 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 定义任何签名而不是为帐户 ID 定义的签名?
谢谢。
好的,我已经想通了。那完全是我的错误。我忘了将产品 sku 传递给 HMSIapModule.obtainOwnedPurchases()
方法。在我通过了产品sku后,它运行良好。
我在我的 React Native 项目中实现了 react-native-hms-iap
。我配置了 here 中提到的所有细节。此外,我可以保证没有签名问题,因为 react-native-hms-account
login with huawei id
在我的应用程序中运行良好。
我已经在 Product Management
中配置了 'subscription' 产品。
但是这个订阅产品并没有反映在我的 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 定义任何签名而不是为帐户 ID 定义的签名?
谢谢。
好的,我已经想通了。那完全是我的错误。我忘了将产品 sku 传递给 HMSIapModule.obtainOwnedPurchases()
方法。在我通过了产品sku后,它运行良好。