Before developing your app, you can follow instructions in the codelab to experience how to quickly integrate IAP into an app.
If you need to use multiple HMS Core kits, use the latest versions required for these kits.
Test device: a Huawei phone running EMUI 3.0 or later, or a non-Huawei phone running Android 4.4 or later
Follow the steps in the following process when you develop an app.
No. | Step | Description |
|---|---|---|
1 | Configure app information in AppGallery Connect, including registering as a developer, enabling the Merchant Service, creating an app, generating a signing certificate fingerprint, configuring the signing certificate fingerprint, enabling IAP, and setting IAP parameters. | |
2 | Integrate the IAP SDK into your app. | |
3 | Before building the APK, configure the obfuscation configuration file to prevent the HMS Core SDK from being obfuscated. | |
4 | Create and configure your products in AppGallery Connect and pass the product ID and type when your app calls the API for in-app purchases. | |
5 | IAP supports the following types of products: consumables, non-consumables, and subscriptions. Purchase Implementation tells how to implement the processes of purchasing the three types of products. If your app provides consumables, you have to do another task, that is, implementing the redelivery process for consumables. If you want to learn more about subscriptions, see Subscription Functions. Develop functions based on your service needs. | |
6 | (Optional) Server-Side Development | The task of performing server-side development is necessary when you need to call APIs of the IAP server (for example, the order service needs to call the purchase token verification API provided by the IAP server) or some complex service logic needs to be implemented but your app cannot achieve it by itself. |
7 | Use the tool offered by Huawei to automatically check your app before release. | |
8 | Complete your app information in AppGallery Connect, and submit your app for release. |
HMS Toolkit provides end-to-end tools (including those for app creation, free real-device debugging, and releasing) that you need to develop your own HMS Core-integrated app and release it, with lower costs and higher efficiency.
If you want to integrate IAP using HMS Toolkit, follow the instructions here.