Skip to content Skip to sidebar Skip to footer

Google Play Billing Method "querypurchasehistoryasync" Not Getting All Purchases

I have 4 subscription types in the app I'm developing. Two monthly (one with discount) and two yearly (one with discount). I am in the testing step. When I ask the purchases histor

Solution 1:

It's difficult to understand your situation without you providing a code snippet. But here is a general implementation of queryPurchaseHistoryAsync. If you are still having problems, please provide more context such as your actual code snippet and where you are making the call. For the following snippet -- just for testing -- I am making the call right before I call queryPurchases.

privatefunqueryPurchaseHistoryAsync(){
    playStoreBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.SUBS){
        responseCode, purchasesList ->
        if(purchasesList.isNullOrEmpty()){
            Log.d(LOG_TAG,"history for SUBS is empty")
        }else{
            Log.d(LOG_TAG,"history subs has ${purchasesList.size} items : ${purchasesList.toString()}")
        }
    }
    playStoreBillingClient.queryPurchaseHistoryAsync(BillingClient.SkuType.INAPP){
        responseCode, purchasesList ->
        if(purchasesList.isNullOrEmpty()){
            Log.d(LOG_TAG,"history for INAPP is empty")
        }else{
            Log.d(LOG_TAG,"history INAPP has ${purchasesList.size} items : ${purchasesList.toString()}")
        }
    }
}

Also in my cases, I have no problem getting the purchase histories.

Post a Comment for "Google Play Billing Method "querypurchasehistoryasync" Not Getting All Purchases"