0

Does anyone know or know to find out how long a Google Play cache keeps returning purchases if there is no internet? The method call is:

mBillingClient.queryPurchasesAsync(SkuType.INAPP, purchaseResponseListener);

Current behavior if I turn off the internet:

  1. Purchases are returned to onPurchasesUpdated() from what I presume is Google Play's cache
  2. 20s later onBillingError() fires. EDIT: onBillingError() fires due to calling querySkuDetailsAsync(). If that isn't called along with queryPurchasesAsync(), we'd never get an error at all!

How long will a purchase be returned to onPurchasesUpdated if internet continues to be unavailable to Google Play?

Flyview
  • 1,899
  • 1
  • 28
  • 46
  • I was recently working with Billing v5. I found if payment is approved late, and you have closed the app, when you reopen it, the purchase is updated automatically as soon as the Billing connection is re-established. – Haris Dec 10 '22 at 02:14
  • Sure, but that doesn't answer the question. – Flyview Dec 10 '22 at 23:05

1 Answers1

0

I fired up an older phone that hadn't been on in a few weeks. Made sure it did not have internet at all. Google Play was still responding with the cached purchase in onPurchasesUpdated(). So it looks like the cache is not invalidated by time passing.

This means without any extra measures someone could make a purchase, block internet access to Google Play, cancel the order or get a refund, and continue to have the purchase indefinitely.

Flyview
  • 1,899
  • 1
  • 28
  • 46
  • In other words, there is no need to make a custom cache implementation of SKU details, which I assume, was necessary for Billing 3-4? – Akbolat SSS Feb 15 '23 at 13:12
  • @AkbolatSSS No I don't think it was necessary then either but my question was about the queryPurchasesAsync response cache lasting seemingly forever without internet. – Flyview Feb 16 '23 at 20:05