Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java iap v3消耗项目_Java_Android_In App Purchase - Fatal编程技术网

Java iap v3消耗项目

Java iap v3消耗项目,java,android,in-app-purchase,Java,Android,In App Purchase,是否有任何方法可以获取应用程序中所有已消费项目的列表 如果我跑步: IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { Log.d(TAG, "

是否有任何方法可以获取应用程序中所有已消费项目的列表

如果我跑步:

IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
        Log.d(TAG, "Query inventory finished.");
        if (result.isFailure()) {
            Log.e(TAG, "#### IAP Error: Failed to query inventory: " + result);
            return;
        }

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

        // Check for inApp-Items to consume (not subs)
        //getSkuDetails(): type: Value must be 'inapp' for an in-app product or 'subs' for subscriptions.
        if(!inventory.getAllPurchases().isEmpty()){
            Log.d(TAG, "#### IAP 1");
            int count = 0;
            for(Purchase p : inventory.getAllPurchases()){
                count += 1;
                Log.d(TAG, "#### IAP 2");
                Log.d(TAG, "#### IAP Inventory Item" + count + "=" + p.toString());
                if(inventory.getSkuDetails(p.getSku()).getType().equals(IabHelper.ITEM_TYPE_INAPP)){
                    mHelper.consumeAsync(inventory.getPurchase(p.getSku()), mConsumeFinishedListener);
                }
            }
        }
        //          if (inventory.hasPurchase("android.test.purchased")) {
        //              Log.d(TAG, "**** IAP We have android.test.purchased. Consuming it.");
        //              mHelper.consumeAsync(inventory.getPurchase("android.test.purchased"), mConsumeFinishedListener);
        //              return;
        //          }

        //updateUi();
        //setWaitScreen(false);
        Log.d(TAG, "#### IAP Initial inventory query finished; enabling main UI.");
    }
};
我有一份所有非消耗性和非消耗性物品的清单 但我会查找一个列表,其中显示了用户从我的应用程序中获得的所有消费项目

有人能告诉我有什么办法吗