2

我的一些用户告诉我,我的应用程序时不时会忘记购买的订阅。它可以工作 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 商店,它会显示购买的订阅。但该应用程序仍然获得一个空的购买清单。

如果我继续打电话billingClient.startConnection()billingClient.queryPurchasesAsync()在大约 10 分钟后的某个时间点,一次尝试将成功并返回一个非空的购买清单。

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

4

1 回答 1

0

acknowledgePurchase每次购买都需要致电。
有关详细信息,请参阅官方文档文章

于 2021-12-20T08:08:29.790 回答