inApp Billing v3 get Inventory inventory is empty

Viewed 22

I have a problem with testing a multiple purchase (consumer purchase) I get an inventory and look at its contents

inventory.getAllOwnedSkus().size() and it is 0

inventory.getAllPurchases().size() is also 0

Maybe I'm doing something wrong? I use Billing v3. Here is my code:

`_billingHelper = new IabHelper(getActivity().getApplicationContext(), billingPublicKey);

_billingHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {

            public void onIabSetupFinished(IabResult result) {
                try {
                     if (result.isSuccess()) {
                        try {
                              IabBroadcastReceiver unused = InAppBillingController.this._broadcastReceiver = new IabBroadcastReceiver(InAppBillingController.this);

InAppBillingController.this._extContext.getActivity().registerReceiver(InAppBillingController.this._broadcastReceiver, new IntentFilter(IabBroadcastReceiver.ACTION)); _billingHelper.queryInventoryAsync(mGotInventoryListener); `

` IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {

    public void onQueryInventoryFinished(IabResult result, Inventory inventory)
    {
        FREUtils.log("getAllOwnedSkus "+inventory.getAllOwnedSkus().size()) // is 0
        FREUtils.log("getAllPurchases "+inventory.getAllPurchases().size()) // is 0

Purchase coinsPurchase = inventory.getPurchase("consume_test"); FREUtils.log("coinsPurchase = "+coinsPurchase); // is null _billingHelper.consumeAsync(coinsPurchase,mConsumeFinishedListener); //is error : coinsPurchase is null I can't figure out why inventory.getPurchase("consume_test") returns null. if you call_billingHelper.launchPurchaseFlow` on this product offers to buy a product appear, but I need multiple purchases of one product

product information I can get:

{"products":[{"id":"consume_test","title":"consume_test (ru.example.match3 (unreviewed))","description":"consume_description","type":"inapp","price":29.92038,"priceString":"29,92 TRY","locale":"","countryCode":"","currencySymbol":" TRY","internationalCurrencySymbol":"","currencyCode":"TRY","itemType":"inapp","source":"{\"productId\":\"consume_test\",\"type\":\"inapp\",\"title\":\"consume_test (ru.example.match3 (unreviewed))\",\"name\":\"consume_test\",\"description\":\"consume_description\",\"price\":\"29,92 TRY\",\"price_amount_micros\":29920380,\"price_currency_code\":\"TRY\",\"skuDetailsToken\":\"AEuhp4KZTvtU_uJ7K17R-emt3KPdjjmCsR0VIP0R4QSDapfCgC_FrkQhhyvvhiYVz7I=\"}"}]}

how can I solve this problem?

0 Answers
Related