アプリで消費されたすべてのアイテムのリストを取得する方法はありますか?
私が実行した場合:
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.");
}
};
すべての非消費アイテムと非消費アイテムを含むインベントリを取得しましたが、ユーザーがアプリから取得したすべての消費アイテムを示すリストを探しています。
これを行う方法があれば教えてもらえますか?