Search code examples
androidandroid-asynctaskgoogle-playin-app-purchasein-app-billing

getSkuDetails() returns 0 items returns empty array DETAILS_LIST


I am building the "inapp" billing system in my application. After i execute

skuDetails = mService.getSkuDetails(3, "my_app_package_name", "inapp", bundle);
ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

I always get responseList.size() equal to 0, even if i have set 2 items in "in-app products" in the developer console, and i am passing them to:

ArrayList<String> skuList = new ArrayList<String> ();
skuList.add("first_id");
skuList.add("second_id");
Bundle bundle = new Bundle();
querySkus.putStringArrayList("ITEM_ID_LIST", bundle);

The app is currently in Draft.

The operation result code is 0.

I double checked the base64 key i pass to:

mHelper = new IabHelper(this,Config.getBase64publicKey());

that i got from services and API menu.

I tried .getSkuDetails() both in main thread or in an asynctask.

Can somebody help me out or suggest other things to check?


Solution

  • Draft app testing is no long supported for testing in-app purchases. Hence you are getting an empty response.

    1. You need to move them to alpha or beta channel or
    2. Add a static response.

    https://developer.android.com/google/play/billing/billing_testing.html#draft_apps