gpt4 book ai didi

Android - BillingClient 返回空的购买 list

转载 作者:行者123 更新时间:2023-12-05 00:00:45 25 4
gpt4 key购买 nike

我的一些用户告诉我,我的应用时不时会忘记购买的订阅。它工作了 3-4 天,然后就忘记了。这是一个非常重要的问题,因为用户可能会怀疑存在欺诈行为。我正在使用计费库 4.0.0,并且我已经按照 Google 的指南实现了计费逻辑。

据我所知,当计费服务连接因某种原因中断时,就会发生这种情况。 (例如 Play 商店正在更新)

我已经成功地通过以下方式复制了这个场景

- Disable internet connection
- Clearing Play Store app data
- Fresh launch of my app.
- Call billingClient.startConnection()
onBillingSetupFinished called with responseCode BILLING_UNAVAILABLE
user sees -> The app says "no subscription purchased"

- Enable internet connection
- re-initialize BillingClient.
onBillingSetupFinished called with responseCode OK. billingClient.isReady() returns true.
- Call billingClient.queryPurchasesAsync() and billingClient.querySkuDetailsAsync().
onSkuDetailsResponse is called with the skuDetailsList filled with all the proper data. However:
onQueryPurchasesResponse is called with empty purchase list -> Again user sees "no subscriptions purchased"

重要 如果此时我打开 Play 商店,它会显示已购买的订阅。但是该应用程序的购买列表仍然是空的。

如果我在大约 10 分钟后的某个时刻继续调用 billingClient.startConnection()billingClient.queryPurchasesAsync(),一次尝试将成功并返回一个非空的购买列表.

是否可以让 Play 商店刷新我的应用的订阅数据?如何优雅地处理这种情况?

最佳答案

每次购买都需要调用acknowledgePurchase
参见 the official docsthe article了解更多详情。

关于Android - BillingClient 返回空的购买 list ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70415672/

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