Huawei IAP for libGDX Games
Hi folks! In this guide I’ll explain how to integrate the Huawei IAP with GDX-Pay, a libGDX extension library for IAP.
What’s GDX-Pay?
GDX-Pay is a libGDX extension that aims to provide a cross-platforms API
for IAP.
It supports the following platforms:
• Google Play;
• Apple App Store;
• Amazon App Store;
• Huawei App Gallery (starting from version 1.2.0, but I suggest to use the 1.3.0-SNAPSHOT version)
For further information, please visit: https://github.com/libgdx/gdx-pay
Requirements
• EMUI 3.0+ / Android 4.4+
• HMS Core 4.0.0.300+
• Android Studio 3.0+
Preparation
• Create an app in AppGallery Connect.
• Create a libGDX project.
• Generate a signature certificate.
• Generate a signature certificate fingerprint.
• Configure the signature certificate fingerprint.
• Add the app package name and save the configuration file.
• Configure the Maven repository address and AppGallery Connect gradle
plug-in.
• Configure the signature file in Android Studio.
For further information, please visit:
• Enable the IAP Api service on AGC Console (Manage APIs)
- Add IAP products on AGC console
Finally coding!
Gradle:implementation "com.badlogicgames.gdxpay:gdx-pay-android-huawei:1.3.0-SNAPSHOT"
Now, in your Activity extending the AndroidApplication class (a libGDX class), You have to instantiate the HuaweiPurchaseManager, like this:
The following are all the action that You can do with the HuaweiPurchaseManager:
Official GDX-Pay-Huawei Example project here:
THANKS!
Bye Folks :}