应用内结算v3测试购买无法跨设备运行

时间:2014-10-27 15:34:10

标签: android in-app-billing

我已在我的开发者帐户中设置了三个托管项目以进行应用内购买,而我的应用目前位于Play商店的Beta版渠道中。

我想测试使用相同Google帐户的两台设备上的应用内购买 - 但我发现只有购买的设备才能正确查找购买。第二台设备使用相同的Google帐户,但未找到该商品。

是否应该在使用同一Google帐户的任何设备上测试帐户结算工作?

我正在使用结算帮助程序库,并在启动时查看我的代码以检查购买情况:

ActivityStartUp.java

@Override
public void onIabSetupFinished(IabResult result) 
{
    if (!result.isSuccess()) 
    {
        LOGD(TAG, "In-app Billing setup failed: " + result);
        startApplication();
    } 
    else 
    {             
        LOGD(TAG, "In-app Billing is set up OK");

        // Query In-App billing for purchases
        mHelper.queryInventoryAsync(new QueryInventoryFinishedListener() 
        {
            @Override
            public void onQueryInventoryFinished(IabResult result, Inventory inv) 
            {
                if (inv.hasPurchase(Globals.ITEM1_SKU) || 
                    inv.hasPurchase(Globals.ITEM2_SKU) ||
                    inv.hasPurchase(Globals.ITEM3_SKU))
                {
                    // Store PRO purchase state
                    AccountUtils.setProVersion(ActivityStartUp.this, true);

                    LOGD(TAG, "Ad-free.  User has purchased the Upgrade :)");
                }
                else
                {
                    // Store PRO purchase state
                    AccountUtils.setProVersion(ActivityStartUp.this, false);

                    LOGD(TAG, "Using the free version, with Ads");
                }

                // Start the application
                startApplication();
            }
        });
    }
}

0 个答案:

没有答案
相关问题