0

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
            }
        }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.