I am using Kotlin Google Play Billing Library 8 to query the subscriptions already bought by the user. I can get purchaseToken and subscription ProductId BUT unfortunately there is no information about the base plan (or offer) that is bought by the user. How can I retreive the base plan related to a purchaseToken. I want to do it locally via Billing Library not by sending purchase token to my server and ask from the Google.
suspend fun queryCurrentPurchases(){
val purchaseResult = billingClient.queryPurchasesAsync(
QueryPurchasesParams.newBuilder().setProductType(ProductType.SUBS).build())
if (purchaseResult.billingResult.responseCode==BillingResponseCode.OK){
purchaseResult.purchasesList.forEach {
println("${it.purchaseToken}, ${it.isAcknowledged}")
it.products.forEach { productId -> println(productId)}
//I need to know what base plan user has bought
}
}
}