在什么条件下都在应用程序内结算版本3服务器更改提供客户端设备上? [英] Under What Conditions are In-App Billing Version 3 Server Changes Made Available on Client Devices?

查看:130
本文介绍了在什么条件下都在应用程序内结算版本3服务器更改提供客户端设备上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

测试应用内计费版3已取得未predictable由一个事实,即谷歌Play应用缓冲器数据从谷歌播放服务器,和缓冲过程中没有充分证明。特别是,如果一个购买是由上一个用户的装置之一,它可能无法立即由相同的用户拥有的其他设备上可见。

Testing In-App Billing Version 3 has been made unpredictable by the fact that the Google Play app buffers data from the Google Play servers, and the buffering process is not well-documented. In particular, if a purchase is made on one of a user's devices, it may not be immediately visible on a different device owned by that same user.

推荐的做法是一个应用程序来检查所有已购买的产品的库存在启动时。但是,有时候这种检查使用缓冲数据已经过时,原因,或通过谷歌结帐(例如,退款或取消的订单)。

Recommended practice is for an app to check the inventory of all purchased products when it is started. But sometimes this check uses buffered data that is already stale due to updates made via the same app on a different device, or via Google Checkout (e.g., a refund or a canceled order).

什么是下一个变化做出购买谷歌播放服务器上的数据的情况下,可用在未启动该更新的设备上运行的谷歌Play应用?

What are the circumstances under which a change made to purchase data on the Google Play servers becomes available on a Google Play app running on a device that did not initiate that update?

具体而言,一个人如何可以在测试()使用queryInventoryAsync检查返回数据的过程中确保(与TrivialDrive示例应用程序提供的IabHelper类的方法)反映的是presently的谷歌播放服务器上,而不是而可能是陈旧的缓冲数据?

Specifically, how can one ensure during testing that data returned by a check using queryInventoryAsync() (a method of the IabHelper class supplied with the TrivialDrive sample app) reflects what is presently on the Google Play servers, rather than being possibly stale buffered data?

推荐答案

下面是我自己的经验,购买与一台Nexus 7平板电脑上运行的应用程序,然后使用在Nexus One手机上运行相同的应用程序检测到购买一个物品。使用测试帐户,它被应用于草稿模式上传一个应用程序进行以下描述的测试(未公开)。测试帐户被宣布在开发者控制台应用程序草案,并且是主要考虑两个测试设备。

Here is my own experience purchasing an item with an app running on a Nexus 7 tablet and then detecting that purchase using the same app running on a Nexus One phone. The testing described below was performed using a test account for an app that was uploaded in draft mode (not yet published). The test account was declared on the Developer Console for the draft app, and was the main account for both test devices.

作出购买是一个非自耗性的项目。购买使用附带TrivialDrive示例应用程序中的IabHelper类的变体进行。调用来进行购买的IabHelper方法是launchPurchaseFlow()。

The purchase made was of a non-consumable item. The purchase was made using a variant of the IabHelper class provided with the TrivialDrive sample app. The IabHelper method invoked to make the purchase was launchPurchaseFlow().

只要一次作出收购,该项目加入到购买的物品清单返回时,随后用IabHelper的queryInventoryAsync()方法,相同的设备。

As soon as the purchase was made, the item was added to the list of purchased items returned to that same device when IabHelper's queryInventoryAsync() method was subsequently used.

然而,由同一个帐户拥有一个独立的Nexus One的设备,开始的时候,进行调用queryInventoryAsync(),但返回使用该方法并没有收到购买的物品清单的购买项目。

However, a separate Nexus One device owned by the same account, when started, performed a call to queryInventoryAsync() but did not receive the purchased item in the inventory of purchased items returned using that method.

如果,然而,Nexus的一个装置被用于发起购买使用launchPurchaseFlow()相同的项目时,返回的消息(在一个对话框,弹出在显示屏的前面,将已被用来制造购买),这表明该项目无法购买,因为它已经拥有。这发生不到15分钟的购买是从的Nexus 7开始后,显示的数据是相当及时的可用谷歌播放服务器上,但不能自动获得在Nexus One上,,直到的尝试从Nexus One的设备已开始重新购买该项目。

If, however, the Nexus One device was used to initiate a purchase of the same item using launchPurchaseFlow(), a message was returned (in a dialog that popped up in front of the display that would have been used to make the purchase), indicating that the item cannot be purchased because it is already owned. This occurred less than 15 minutes after the purchase was initiated from the Nexus 7, showing that the data was fairly promptly available on the Google Play servers, but was not automatically available on the Nexus One, until the attempt to re-purchase the item from the Nexus One device was initiated.

在此之后失败的企图购买已经拥有的项目,该项目的没有的在Nexus One上出现queryInventoryAsync()的后续调用。这表明,购买该项目的尝试引发了谷歌Nexus One的同步播放应用程序的缓存数据与谷歌播放服务器上的可用数据。这是的没有的由queryInventoryAsync()本身。触发

Following this abortive attempt to purchase the already-owned item, the item did appear on subsequent invocations of queryInventoryAsync() on the Nexus One. This suggests that the attempt to purchase the item triggered a synchronization of the Nexus One Google Play app's buffered data with the data available on the Google Play servers. This was not triggered by queryInventoryAsync() itself.

我测试,而不是使从Nexus One的购买已经拥有的项目,试图在其中,我在谷歌Play应用删除缓存中的第二个场景。这确实的没有的启动由queryInventoryAsync返回的数据的更新();该数据保持不变。

I tested a second scenario in which, instead of making an attempt to purchase the already-owned item from the Nexus One, I deleted the cache in the Google Play app. This did not initiate an update of the data returned by queryInventoryAsync(); that data remained unchanged.

我测试,其中第三种情况,而不是使从Nexus One的购买已经拥有的项目的尝试,我干脆关机了Nexus One,然后再通电起来。在此之后,当我跑相同的应用程序,它执行的queryInventoryAsync()请求,这是从的Nexus 7购买的,其实是在购买的物品返回列表中可见的项目。

I tested a third scenario in which, instead of making an attempt to purchase the already-owned item from the Nexus One, I simply powered down the Nexus One and then powered it up again. After this, when I ran the same app and it performed a queryInventoryAsync() request, the item that was purchased from the Nexus 7 was in fact visible in the returned list of purchased items.

我从上面的谷歌Play应用正试图减少它向谷歌通过缓冲购买本地,只有在更新自己,当特定的触发播放服务器的往返数得出结论。我已经确定了两个触发器作为1)购买一个已经拥有项目的尝试; 2)在设备上的谷歌Play应用的重新启动运行。特别是,queryInventoryAsync()做的没有的发起这样的更新,因此可能会返回过时的数据,如上所述。

I conclude from the above that the Google Play app is attempting to reduce the number of round trips that it makes to the Google Play servers by buffering purchases locally and only updating itself when specific triggers occur. I have identified two triggers as being 1) an attempt to purchase an already-owned item and 2) a reboot of the device on which the Google Play app is running. In particular, queryInventoryAsync() does not initiate such an update, and so may return stale data, as described above.

知道了上述可以使检测更有效,更容易混淆,因为它允许人们故意触发从数据缓冲数据的更新上可用的谷歌播放服务器

Knowing the above can make testing more efficient and less confusing, because it allows one to deliberately trigger updating of the buffered data from the data that is available on the Google Play servers.

这篇关于在什么条件下都在应用程序内结算版本3服务器更改提供客户端设备上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆