我正在尝试确认我在 android 上的购买,但我每次都收到响应代码 3 并显示消息“Google Play In-app Billing API version is less than 9”。购买正在使用所需的所有详细信息、令牌等来实现此功能。但是,它仍然无法正常工作。
我在我的应用程序中使用最新版本的 IAB 库:
private fun acknowledgeNonConsumablePurchasesAsync(nonConsumables: List<Purchase>) {
nonConsumables.forEach { purchase ->
val params = AcknowledgePurchaseParams.newBuilder().setPurchaseToken(purchase
.purchaseToken).build()
playStoreBillingClient.acknowledgePurchase(params) { billingResult ->
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {
disburseNonConsumableEntitlement(purchase)
}
else -> Log.d(LOG_TAG, "acknowledgeNonConsumablePurchasesAsync response is ${billingResult.debugMessage}")
}
}
}
}