Yes, there is. Kindly see this >> https://codelabs.developers.google.com/codelabs/play-billing-codelab/#1
val skuList = arrayListOf("sku_id_of_in_app_product","sku_id_of_in_app_product")
val itemType = SkuType.INAPP // or SkuType.SUBS that corresponds with the skuList
val skuDetailsParams = SkuDetailsParams.newBuilder().setSkusList(skuList).setType(itemType).build()
mBillingClient.querySkuDetailsAsync(skuDetailsParams, object : SkuDetailsResponseListener{
override fun onSkuDetailsResponse(responseCode: Int, skuDetailsList: MutableList<SkuDetails>?) {
responseListener.onSkuDetailsResponse(responseCode, skuDetailsList);
}
})
Your Listener: You need to use a listener so that you will be able to get a response when the Asynchronous Query is done!
val responseListener = SkuDetailsResponseListener { responseCode, skuDetailsList ->
if (responseCode == BillingClient.BillingResponse.OK && skuDetailsList != null) {
val inList = ArrayList<SkuRowData>()
for (details in skuDetailsList) {
Log.i(TAG, "Found sku: $details")
inList.add(SkuRowData(details.sku, details.title, details.price, details.introductoryPrice, details.description, details.type))
}
}
}
SkuRowData is just a model class
class SkuRowData(sku: String?, title: String?, price: String?, introductory_price: String?, description: String?, type: String?)
Be aware that you can only get introductory Price for subscription in app product!