When ever subscription has expired after its duration or if i cancel manually. It always in renewel status. I always got result in response 2 which renewel status after buy new subsciption. I didn’t found any cause of this problem.
billingClientInApp?.queryPurchasesAsync(
QueryPurchasesParams.newBuilder().setProductType(BillingClient.ProductType.SUBS).build()
) { billingResult, purchaseList ->
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
purchaseListing.clear()
alreadyPurchasedTokens.clear()
if (!purchaseList.isNullOrEmpty()) {
purchaseListing.addAll(purchaseList)
purchaseListing.forEach { item->
alreadyPurchasedTokens.add(item.purchaseToken)
}
} else {
purchaseListing.clear()
}
} else {
Log.e(TAG, billingResult.debugMessage)
}
}