gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 09:39:35 35 4
gpt4 key购买 nike

在我看来,我一次只能在 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)
}
}
}

最佳答案

一个用户只能拥有同一个应用内商品一次,但他可以拥有不同同时元素。

其他解决方案是将元素视为消耗品:

如果 billingClient.consumeAsync()在购买过程结束时调用,然后他可以再次购买相同的元素,但是您必须通过自己的方式(可能通过后端服务器)跟踪他购买了多少次。

关于android - 我可以通过 Android App 中的 Google Play 一次购买多件商品吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61907342/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com