HMS-Core/hms-iap-clientdemo-android-studio

obtainProductInfo() returns empty list

4ntoine opened this issue · 11 comments

I'm requesting product info and getting empty result.getProductInfoList():

Снимок экрана 2021-01-14 в 1 07 49

In the logs i can see:

E/hms_pay: AgreementHelper inconsistent countries -> signCountry = , currentCountry =

Here is the full log for "hms_pay" tag:
productinfo.txt.zip

Merchant service agreement is signed.
IAP service agreement is signed and IAP products are added in Huawei console.
IAP service API is enabled, Analytics service API is also enabled.
The test user is logged to Huawei account on the device and isEnvReady() and obtainOwnedPurchaseRecord() succeed.
Requested price type is set according to what is set in feature in the console (non_consumable).

What's wrong?

I'm sure i request for the right productID, but just out of curiosity i've also tried for inexisting productID and got the same "success" response.

Oh, just trying different options i was able to get it and it seems to be a bug.

I've added the product as non_consumable ("однократные"):
Снимок экрана 2021-01-14 в 1 28 10

I've requested it as non_consumable:

request.setPriceType(IapClient.PriceType.IN_APP_NONCONSUMABLE);

And this results in empty list.

BUT if i request it as consumable:

request.setPriceType(IapClient.PriceType.IN_APP_CONSUMABLE);

i can get all the info:
Снимок экрана 2021-01-14 в 1 33 08

Now the questions are:

  • "where is the bug?" (console UI, IAP SDK, server-side)
  • how to make it working now and don't break it later when you fix it?

I also have to set request.setPriceType(IapClient.PriceType.IN_APP_CONSUMABLE); in createPurchaseIntent()

I've read the explanation and it's very misleading translation to Russian in console UI which means quite the opposite.

Sorry to make you confused. I'm puzzled if you want to set your product non-consumable which means the user can buy the product once and own it forever, or you want to set your product consumable which means the user can buy the procuct multiple times.

@iap-git Thanks for the clarification. I clearly understand the meaning in English and i was confused with local translation in dev console UI when creating products. Also i did not find where i can change dev console UI language to English.

Hi developer, thank you for your feedback. Now I get it.
When we describe Non-consumables (buy once, own forever) and Consumables (buy once, and need repurchase after being used up), we want to use Многоразовые and Одноразовые. Due to a mistake for which we failed to locate cause, Однократные and Многократные are incorrectly used on the console UI.
We’ll fix that in the next version. Sorry for the inconvenience caused.
Btw, which pair of translation do you think is the clearest for you guys?
A: однократные/многократные (current version, might be misleading)
B: одноразовые/многоразовые (suggested version, sound more like to use it once or for multiple times)
C: расходуемые/нерасходуемые

If i'm not mistaken, you want to provide a non-consumable product, so you need to choose 'многократные' in the console ui for now and just request as you had posted before:
request.setPriceType(IapClient.PriceType.IN_APP_NONCONSUMABLE);

If you have any questions, please for free contact us.

It is still translate bug in console.
Снимок экрана 2021-06-09 в 16 55 25

Well, wery misleading russian translation. I just configured all products as "многоразовые". I thought they are consumable, but they DON'T.
C: расходуемые/нерасходуемые would be better

Merchant service agreement is signed.
IAP service agreement is signed and IAP products are added in Huawei console.
IAP service API is enabled, Analytics service API is also enabled.
The test user is logged to Huawei account on the device and isEnvReady() and obtainOwnedPurchaseRecord() succeed.
Requested price type is set according to what is set in feature in the console (subscription).

What's wrong?
I cant get the product info when even sign in with debugging account

Results i get
{"errMsg": "success", "productInfoList": [], "returnCode": 0, "status": {"describeContents": 0, "errorString": "success", "hasResolution": false, "hashCode": 947086020, "isCanceled": false, "isInterrupted": false, "isSuccess": true, "statusCode": 0, "statusMessage": "success"}}

@UzairSoken The possible causes are as follows:
1.The priceType is not match the ProductID.
2.A space is displayed when the ProductID is copied.
3.Pls Check whether the subscription product set in the PMS is correct, whether the subscription product is activated, and whether the product is valid.

If the issue persists, pls provide your APPID and a detailed error log for us to check.