Please help me with this issue. I consume the product properly after the user buys it, but if the app isn’t removed from the background and the user tries to buy the same product again, it shows an error: ‘You already own this item.’ How do I fix this? Please provide a solution.
I am using 6.1.0 Billing Version there.
After completing the purchase, I consume the product using the code below:
fun consumePurchase(purchaseToken: String, orderId: String) {
val consumeParams =
ConsumeParams.newBuilder()
.setPurchaseToken(purchaseToken)
.build()
billingClient?.consumeAsync(consumeParams) { billingResult, outToken ->
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
}
}
}