EvilMindDevs / hms-unity-plugin

The HMS Unity Plugin makes it easy to include Huawei Mobile Services into Unity-based games. Authentication, in-app purchases, push alerts, ads, and interaction with gaming services are just a few of the basic capabilities that this formidable tool makes available to your applications.
https://evilminddevs.gitbook.io/hms-unity-plugin/
316 stars 42 forks source link

Huawei Unity IAP Did Not Worked. #488

Closed MushoodMunir closed 6 months ago

MushoodMunir commented 6 months ago

Describe the bug & problem I am trying to implement Huawei IAP in my Unity Project. However, I am not able to launch Huawei payment flow when clicking on my IAP's button. I followed the online available tutorials and created the IAP products on Huawei app gallery console. According to my understanding everything is configured correctly but receiving error when IAP is initialized.

Expected behavior IAP should work and payment screen should launch successfully.

Screenshots & Detailed log

Screen Shot 2024-04-28 at 1 48 48 PM Screen Shot 2024-04-28 at 1 44 15 PM Screen Shot 2024-04-28 at 2 06 17 PM Screen Shot 2024-04-28 at 2 06 55 PM Screen Shot 2024-04-28 at 1 27 35 PM

Environment

Smartphone

github-actions[bot] commented 6 months ago

Thank you for reporting this issue/advice.

We will get back to you as soon as possible.
Would you like to star our plugin to support us? :sparkles:

MushoodMunir commented 6 months ago

Is there any update on this?

Andronovo-bit commented 6 months ago

Hi @MushoodMunir. We are under review. If you want, you can try the suggestions below until this process is complete.

https://github.com/EvilMindDevs/hms-unity-plugin/tree/master/Assets/Huawei/Demos/IAP/Second%20Demo-Menu_Store

MushoodMunir commented 6 months ago

No, I didn't use any AccountKitManager before IAP operation. I directly tried to initialize the IAP flow by checking "Initialize On Start" option from Kit Settings -> IAP dialogue. And it failed to Initialize straight away. Is't AccountKitManager will come into play after the purchases are initialized successfully and at the time user will try to buy any IAP? Or AccountKitManager has something to do with the successful Initialization of IAP's? If there is some kind of dependency between these two can you please guide me to workflow of it?

Andronovo-bit commented 6 months ago

Basically, if the user can't login, they can't do any IAP operations. This is normal, because this transaction has to belong to an account.

The purpose of the "Initialize On Start" option is to prepare your IAP products for use. Don't be related to any account or user operation.

If you look at the at the below demo scene file, you can see the guide in the code file. Writes in comment line what you need to do, and you can also see how to do user operations or start operations.

https://github.com/EvilMindDevs/hms-unity-plugin/blob/master/Assets/Huawei/Demos/IAP/Second%20Demo-Menu_Store/MainMenuManager.cs

MushoodMunir commented 6 months ago

Got it, As you said that The purpose of the "Initialize On Start" option is to prepare your IAP products for use. Don't be related to any account or user operation. Here i get the problem as products are not being Initialized at all and i get some error code in response visible in screenshots that i attached.

Andronovo-bit commented 6 months ago

Did you follow the 5-step instructions in the code file I shared above and the structure in the "Start" method? Are you still getting an error?

Also, can you try with another Android device ?

Or

Can you update the HMS Core version of of your device (Honor 8S)? (Grater than 3.0 Hms core version) @MushoodMunir

MushoodMunir commented 6 months ago

It worked with singing in using AccountKit before performing any IAP operations.

github-actions[bot] commented 6 months ago

Thank you for using our repository! We're glad we could help solve your issue. If you found our repository helpful, please consider giving us a star ⭐ on GitHub: https://github.com/EvilMindDevs/hms-unity-plugin

Your support helps us continue to improve our repository and provide valuable resources for others.