安卓:哪个响应code的确在应用程序在超时的计费V3的回报? [英] Android: Which response code does in-app billing V3 return upon timeout?
问题描述
这响应状态code(S)将在谷歌播放应用内结算SERV {冰,呃} V3在网络超时条件回报?这是统一在所有它的功能?
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?
推荐答案
我将在这里介绍我的发现。我已经(,G服务框架4.1.2 GP商店V3.10.10,GP服务2.0.12),通过将主机的插头测试这对一个AVD安装了功能齐全的全科医生。
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()
方法返回一个缓存的结果,如果可能的(请注意,我们的没有的谈论缓存的外服务的这里,但一个的直接的getPurchases的调用)的。当然,这意味着一个将几乎总是得到除非当服务被因重新初始化到本地数据丢失一个缓存的结果 - 这是不太可能并常常需要不被在上特殊方式处理的情况下应用水平。 - 的
consumePurchase()
方法将返回整数值6(BILLING_RESPONSE_RESULT_ERROR
)之后,presumed内部20秒超时净额(所以加了一点时间,直到结果code被调用者看到的)。尽管BILLING_RESPONSE_RESULT_ERROR
我怀疑这个API操作过程中被描述为致命错误
,因为没有其他错误code将使意义在这里;不幸的是,这个词的致命的仍然是一个暂时的情况有点不恰当,如超时。 -
getSkuDetails()
似乎表现得就像consumePurchase()
。 更新:现在有证据表明,getSkuDetails()
可以在本地服务中访问缓存的信息,太 - 这看起来好像
getBuyIntent()
工作正常没有连通,如果该项目已经知道的服务。这就解释了为什么Hartok看到一个空白GP购买画面:这不是一个问题,您可以通过IAB V3买入意图没有连接
- The
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. - The
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 despiteBILLING_RESPONSE_RESULT_ERROR
being described as aFatal 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 likeconsumePurchase()
. Update: There's now evidence thatgetSkuDetails()
can access cached information within the local service, too.- It looks as if
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.
结论:应用内结算服务V3似乎有内部缓存和20秒的服务器连接超时工作。对于服务器通信错误的本地缓存无法解决,响应code 6被使用。
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.
这篇关于安卓:哪个响应code的确在应用程序在超时的计费V3的回报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!