我可以一次通过Android App中的Google Play购买多个商品吗?

问题描述 投票:5回答:1

在我看来,我一次只能在Google App中购买一项。

代码A来自项目play-billing-samples,您可以看到here

purchases: MutableList<Purchase>可能存在多个物品,看来我可以通过Google Play同时购买这些物品,对吗?

代码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)
        }
    }
}
android google-play
1个回答
0
投票

一个用户只能拥有一次相同的应用内商品,但是他可以同时拥有不同

© www.soinside.com 2019 - 2024. All rights reserved.