In my mind, I can only puchase one item at one time in Google App.
The Code A is from the project play-billing-samples, you can see here.
purchases: MutableList<Purchase>
maybe exist multiple items, it seems that I can purchase these items simultaneously through Google Play, right?
Code A
override fun onPurchasesUpdated(
billingResult: BillingResult,
purchases: MutableList<Purchase>?
) {
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {
// will handle server verification, consumables, and updating the local cache
purchases?.apply { processPurchases(this.toSet()) }
}
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED -> {
// item already owned? call queryPurchasesAsync to verify and process all such items
Log.d(LOG_TAG, billingResult.debugMessage)
queryPurchasesAsync()
}
BillingClient.BillingResponseCode.SERVICE_DISCONNECTED -> {
connectToPlayBillingService()
}
else -> {
Log.i(LOG_TAG, billingResult.debugMessage)
}
}
}