How long does Android BillingClient store results offline, for onQueryPurchasesResponse?

58 Views Asked by At

I am currently testing my integration of BillingClient.

One of the tests is to close all internet connections of the mobile phone. I did expect that this will create a call to onBillingServiceDisconnected(). But it doesnt. So clearly there is no internet connection, and it is impossible for BillingClient to connect to Google Servers. But ... when calling mBillingClient.queryPurchasesAsync() i do get a callback to onQueryPurchasesResponse(). The List of purchases is -good-. Obviously Google cached this locally from previous calls when the Internet was on. I love that ! Great job. I just dont know how reliable that is. This is not specified. Can i rely on this ? How long will it store ? I have different products (subscriptions), with variable length (week, month). Is the caching code good enough to make its own guess (= will it handle weekly subscriptions differently from monthly ones ?).

I thought i would have to handle this myself, and had code prepared to do plausibility checks, using timestamps. Has anybody any experience with this ? This is V5 of BillingClient.

0

There are 0 best solutions below