Which response status code(s) will the Google Play In-App Billing Serv{ice,er} V3 return upon a network timeout condition? Is this uniform amongst all of its functions?
Usually the BILLING_UNAVAILABLE error means that your Android device is running an unsupported version of Android or Play services. Other things to check when you get this error: Are you logged in to the correct Google Account on the device/emulator? Try logging out and logging back in.
The server-side in-app billing API helps you define the status of a subscription when a user is signed into your another service.
Google Play's billing system is a service that enables you to sell digital products and content in your Android app. You can use Google Play's billing system to sell a one-time product or subscriptions on a recurring basis.
I will describe my findings here. I have tested this on an AVD with a fully featured GP installed (GP Store V3.10.10, GP Services 2.0.12, G Services Framework 4.1.2), by pulling the host's plug.
getPurchases()
method returns a cached result if possible (please note that we're not talking about a cache outside of the Service here but a direct call of getPurchases). Of course, this means that one will almost always get a cached result except when the Service is being re-initialized due to the loss of local data -- a case which is not very likely and often needs not be treated in special ways on the application level.consumePurchase()
method will return the integer value 6 (BILLING_RESPONSE_RESULT_ERROR
) after a presumed internal net timeout of 20 seconds (so add a bit of time until the result code is seen by the caller). I was suspecting this despite BILLING_RESPONSE_RESULT_ERROR
being described as a Fatal error during the API action
because no other error code would make sense here; unfortunately, the word fatal is still somewhat inappropriate for a temporary condition such as a timeout.getSkuDetails()
appears to behave just like consumePurchase()
. Update: There's now evidence that getSkuDetails()
can access cached information within the local service, too.getBuyIntent()
works fine without connectivity if the item is already known to the service. This explains why Hartok sees a blank GP purchase screen: It's not a problem to get a buy intent from the IAB V3 without connectivity.Conclusion: The In-App Billing Service V3 appears to work with an internal cache and a server connection timeout of 20 seconds. For server communication errors which the local cache cannot resolve, response code 6 is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With