Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么在Google Play中购买应用内产品会自动退款?_Android_Google Play_In App Purchase_In App Billing - Fatal编程技术网

Android 为什么在Google Play中购买应用内产品会自动退款?

Android 为什么在Google Play中购买应用内产品会自动退款?,android,google-play,in-app-purchase,in-app-billing,Android,Google Play,In App Purchase,In App Billing,将应用程序计费库更新为后 实现'com.android.billingclient:billing:2.0.1' 我开始看到退款,甚至在3天后。这怎么可能?谷歌只提到,如果用户在购买后的短时间内卸载应用程序,Purches将获得退款。我想3天不是很短。用户必须在3天内确认购买,否则将退还订阅费: 在PurchasesUpdatedListener中执行以下操作 private val purchaseUpdateListener = PurchasesUpdatedListener { bill

将应用程序计费库更新为后 实现'com.android.billingclient:billing:2.0.1'
我开始看到退款,甚至在3天后。这怎么可能?谷歌只提到,如果用户在购买后的短时间内卸载应用程序,Purches将获得退款。我想3天不是很短。

用户必须在3天内确认购买,否则将退还订阅费:


在PurchasesUpdatedListener中执行以下操作

private val purchaseUpdateListener = PurchasesUpdatedListener { billingResult, purchases ->
for (purchase in purchases) {
    if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) {
        if (!purchase.isAcknowledged) {
                 val acknowledgePurchaseParams = 
                     AcknowledgePurchaseParams.newBuilder()
                     .setPurchaseToken(purchase.purchaseToken).build()

                 billingClient?.acknowledgePurchase(acknowledgePurchaseParams) { 
                     billingResult ->
                         val billingResponseCode = billingResult.responseCode
                         val billingDebugMessage = billingResult.debugMessage

                         Log.v("TAG_INAPP", "response code: $billingResponseCode")
                         Log.v("TAG_INAPP", "debugMessage : $billingDebugMessage")
                        }
         }
 }

大家好,欢迎来到SO!虽然这段代码可以回答这个问题,但提供关于它如何和/或为什么解决问题的附加上下文将提高答案的长期价值。请阅读这篇文章,谢谢。这让我走上了正确的道路。