产品说明未在应用结算对话框中显示(Google快讯对话)

时间:2018-04-19 06:46:07

标签: android

我为我的Android应用程序创建了一个订阅,并将我的应用程序发布为alpha.My问题是当我通过应用程序结算流程时!谷歌警报对话框不显示产品说明,但它确实显示产品名称。这是正常的行为吗?否则如何显示描述(我已经添加了产品说明游戏商店)?请帮帮我。

2 个答案:

答案 0 :(得分:0)

使用此代码获取所有详细信息,如sku名称,描述,价格等。

IabHelper mHelper;
IInAppBillingService mService;

  IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, Inventory inventory) {

     ArrayList<String> inAppType = new ArrayList<String>();
     inAppType.add(SKU_BK_PLAN_1);
     inAppType.add(SKU_BK_PLAN_2);

     Bundle querySkus = new Bundle();
     querySkus.putStringArrayList("ITEM_ID_LIST", skuList);

     Bundle skuDetails = mService.getSkuDetails(3,packageName, inAppType, "inapp");

     int response = skuDetails.getInt("RESPONSE_CODE");
     if (response == 0) {
        ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");
     } 

}

答案 1 :(得分:0)

     IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new 
     IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, Inventory 
    inventory) {

       // Log.d(TAG, "Query inventory finished.");

        // Have we been disposed of in the meantime? If so, quit.
        if (mHelper == null) return;

        // Is it a failure?
        if (result.isFailure()) {
            return;
        }

       // Log.d(TAG, "Query inventory was successful.");

        /*
         * Check for items we own. Notice that for each purchase, we check
         * the developer payload to see if it's correct! See
         * verifyDeveloperPayload().
         */

        Map<String, SkuDetails> allSKU = inventory.getAllSKUDetails();

        if (allSKU != null)

        {
            for (Map.Entry<String, SkuDetails> entry : allSKU.entrySet()) {
                Log.e(TAG, entry.getKey() + "/" + entry.getValue());
                SkuDetails skuDetails = entry.getValue();
                SKU_CODE = skuDetails.getSku();

            }
            try {
                Purchase purchase = 
              inventory.getPurchase(SKU_CODE);
                if (purchase != null && 
                 verifyDeveloperPayload(purchase )) {



              mHelper.consumeAsync(inventory.getPurchase(SKU_CODE),
                            mConsumeFinishedListener);
                    return;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        List<String> productIds = inventory.getAllOwnedSkus();

        for (int i = 0; i < productIds.size(); i++) {
            Log.e(TAG, i + " = " + productIds.get(i));

           // Here You will get the data about product

        }

    }
};