Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with IAP #495

Closed
GauravUMX612 opened this issue Jun 5, 2024 · 15 comments
Closed

Issue with IAP #495

GauravUMX612 opened this issue Jun 5, 2024 · 15 comments
Assignees
Labels
details requested Details requested for the issue timeout and closed A month passed after the solution was given. waiting for confirmation The solution has been given

Comments

@GauravUMX612
Copy link

We have integrated the HMS Evil Minds Plugin in our game, and we are encountering a significant issue with the In-App Purchases (IAP) functionality. When we initiate the IAP process to purchase a product, we do not receive any callback from the IAP plugin. This issue causes our game to get stuck, preventing users from receiving their rewards and completing the purchase process.

Steps to Reproduce:

Step1 : Integrate the HMS Evil Minds Plugin into a Unity project.
Step2 : Implement the IAP functionality as per the documentation.
Step3 : Attempt to purchase any product within the game.
Step4 : Observe that no callback is received from the IAP plugin.

Expected Behavior:
Upon initiating a purchase, the IAP plugin should return a callback indicating the success or failure of the transaction, allowing the game to proceed and the user to receive their rewards.

Actual Behavior:
No callback is received from the IAP plugin, causing the game to hang and preventing the user from receiving their purchased rewards.

Environment:

HMS Evil Minds Plugin Version: 2.3.7
Unity Version: 2021.3.4f1

Additional Information:

We have verified that the IAP configuration and setup are correct as per the documentation.
No errors or logs are generated when the issue occurs, making it difficult to diagnose the problem.
Please investigate this issue at your earliest convenience, as it is critically affecting our game's user experience. If you require any further information or logs, we would be happy to provide them.

Thank you for your assistance.

@github-actions github-actions bot added the new label Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

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? ✨

@Andronovo-bit
Copy link
Collaborator

Hi, @GauravUMX612 , thank you for sharing problem clearly.

We tested our demo scenes, and we didn't face any problems.

  1. You should enable the IAP Kit in Unity and the AG Connect Panel.

  2. You should be sure to add the correct item ID and type

  3. You should revise our IAP scenario. You can look at our demo scenes and scenerio.

  4. You should be sure to initialize the IAP kit and register your callbacks "OnBuyProductFailure" and "OnBuyProductSuccess". Also, users have to sign in to buy any product.

  5. We keep a log record that starts "HMS" in all kits. You can search using this keyword.

If you don't mind could share the log record? We can analyze your log record.

@Andronovo-bit Andronovo-bit added details requested Details requested for the issue labels Jun 5, 2024
@GauravUMX612
Copy link
Author

Hello @Andronovo-bit thank you for Quick Response

I will Check out all Details provided
and also create an Demo Project rather than main Project
will share further logs or details here

@GauravUMX612
Copy link
Author

Hello @Andronovo-bit

I Created one Demo Project and I am Getting
[HMSIAPManager]: Order Payment Failed
for 2 time before getting Purchase Success Callback

Checkout Full Logs
HMSIAPLogs.txt

@Andronovo-bit
Copy link
Collaborator

@GauravUMX612 Hi,

  • You have to make sure that Initilize is finished.
  • You can also use some methods to determine whether the user owns a product or not.
  1. HMSIAPManager.Instance.GetProductsList()
  2. HMSIAPManager.Instance.isUserOwnThisProduct(productId)

Maybe, you can try purchase operation after these methods.

@GauravUMX612
Copy link
Author

@Andronovo-bit Hello,

  • I made the purchase after the IAP is Initialized
  • And for Getting the Product Info I am calling GetProductInfo by giving them list of product ids after intialization Success
  • And also i am calling method RestoreOwnedPurchases after the intialization is successfull so i dont think its an issue of owned purchase
  • Still i added the condition of isUserOwnThisProduct if its true then i am again calling the RestoreOwnedPurchases otherwise i am calling PurchaseProduct

Then also getting same results and Logs
For this time i also sending Code we are using checkout that and let us know if any changes required

HMSIAPLogs 13-06-2024.txt
DomeCode.txt

@Andronovo-bit
Copy link
Collaborator

Andronovo-bit commented Jun 13, 2024

Hi @GauravUMX612 thanks for sharing your demo code and log records,

Can you look at this IAP flowchart ? I try to explain basically IAP scenerio.

DiagramIAP

Can you try to purchase after these steps in diagram ?

And also, I know before I said below things but can you check again ?

  1. Enable Account kit - IAP from kit settings. https://evilminddevs.gitbook.io/hms-unity-plugin/getting-started/quick-start/connect-your-game-with-the-hms-kit-managers
  2. Make sure you enabled IAP and Account kit services in the AppGallery console. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/config-agc-0000001050033072#section382112213818
  3. Add These products to your project. (with same productID) https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/config-product-0000001050033076
  4. Add these products to IAP tab. Unity > Huawei > Kit Settings > IAP. Then click create constant classes

@GauravUMX612
Copy link
Author

Hello @Andronovo-bit Please Check I followed all the steps mentioned above and still getting same results
here are the screenshots and logs
image
image
HWLogs 24-06-2024.txt
DemoCode 24-06-2024.txt

@Andronovo-bit
Copy link
Collaborator

Andronovo-bit commented Jun 25, 2024

Hi @GauravUMX612 ,

I guess, we have a some problems about after purchase status control mecanism.

Can you try below code changes in HMSIAPManager.cs file ?

image

Also callback is working. You can add "Debug.Log" in success("OnBuyProductSuccess") and failure("OnBuyProductFailure") methods on your demo code and you can see it on the android logcat.

@GauravUMX612
Copy link
Author

Hello @Andronovo-bit

The Purchase Failed and then Purchase Success Issue Solved by Updating Code as you mentioned
But I need to verify the Plugin issue where it was not giving any response to the game and plugin getting crashed
I will test that with our QA team and Let you Know
Thank you

@Andronovo-bit Andronovo-bit added the waiting for confirmation The solution has been given label Jul 5, 2024
@GauravUMX612
Copy link
Author

HW.Plugin.Crash.Issue.mp4

Hello @Andronovo-bit Checkout the Video Provided with Logs window where our QA Team Member is facing a problem of Plugin Crash / Black Stuck Screen After Purchase Completed and not giving any response back to the game

@Andronovo-bit
Copy link
Collaborator

Hi @GauravUMX612, We watched this video and reviewed the logs. I believe this is a problem with the screen orientation. After success purchase, as I see, the screen is forced to change orientation.

We tried the demo scene in the plugin and, as you can see in the video below, there were no issues.

Unity_l7Ejn18HUL.mp4

@GauravUMX612
Copy link
Author

GauravUMX612 commented Jul 10, 2024

Hello @Andronovo-bit
I didn't got you what was the issue in the video i sent because in that you can clearly see the plugin crashed or stuck at some black screen

and if its an orientation issue how can i fix it

@Andronovo-bit
Copy link
Collaborator

@GauravUMX612 , At 18 seconds into your video you can see that there is a point that forces it to be vertical or forces to rotate.

I think, you can check the project screen rotation(Oriantation) codes in your project, or you can check if there is any forcing in one direction or the other.

As you can see thare isn't any forcing in I send video before. Screen Oriantation always selected as a "LandscapeLeft".

@Aziz-T Aziz-T added timeout and closed A month passed after the solution was given. and removed new labels Nov 4, 2024
@Aziz-T Aziz-T closed this as completed Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
details requested Details requested for the issue timeout and closed A month passed after the solution was given. waiting for confirmation The solution has been given
Projects
None yet
Development

No branches or pull requests

3 participants