getSkuDetails() returns 0 items returns empty array DETAILS_LIST

一世执手 提交于 2019-12-22 16:28:13

问题


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?


回答1:


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




回答2:


Previously you could test an app by uploading an unpublished "draft" version. This functionality is no longer supported. However, you can test your app with static responses even before you upload it to the Google Play Store. For more information, see Test with static responses.

Source official documentation



来源:https://stackoverflow.com/questions/46887805/getskudetails-returns-0-items-returns-empty-array-details-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!