💰UDP In-App Purchase & Release Store
UDP In-App Purchase (IAP) is a feature that allows you to implement and manage IAP items for your game across different app stores using the UDP SDK.
You can use UDP IAP to initialize the SDK, query the inventory, purchase and consume products, and validate the integration. You can also fill in the IAP catalog in the UDP console to manage your IAP items.
This guide assumes you have a Unity and Huawei AppGallery Developer account. If you do not have an account, it is important to create one first and then continue with the guide for a seamless flow.
This guide is intended to be a practical and step-by-step guide rather than theoretical information. You can learn the theoretical information you are curious about by trying it in the link below 😎
Step 1: Login to Unity Distribution Portal
To get started with UDP IAP, you need to have an account on the Unity Distribution Portal. If you don't have one already, you can create an account or you have already account login here.🖲️
Step 2: Create a Project on UDP
After logging in to UDP, you can create a new project by clicking the "Create Project" button.
Step 3: Add Game on UDP
Once you have created a project, you can add your game to the project by clicking the "Add Game" button and following the prompts.
Shows which store you want to distribute your game in. Since we will distribute our game on AppGallery, we choose this option.
Asks how we will make money in the game, here we need to choose the In-App Purchase option. Because Huawei AppGallery requires this service.
Asks which languages the game information will contain, here you can choose if you want a language other than English.
Asks if there is a region you are especially interested in for distribution.
Asks how long it will take for your game to go live, here you can choose a time according to your own goals. It is not very important.
Premium Price does not support AppGallery, so do not choose it. You can also select Ads if you want to use ads.
Step 4: Create Game Plan on UDP
Next, we can determine the most suitable store for our game by following the game creation steps. In this case, we decide to go with Huawei AppGallery. We then proceed to select the Create Game Plan option, which provides us with a well-defined roadmap to follow.
Step 5: Create a Game in Unity Editor or Open Your Games
In the Unity Editor, create a new project or open an existing project.
Step 6: Login to Unity Editor with the Same Account as UDP
To link your Unity Editor to your UDP project, you need to log in to Unity Editor with the same account as your UDP account.
The game-building process starts with opening our project through Unity Editor, but it's important to remember to use the same account for Unity and Unity Distribution Portal.
Step 7: Install Unity Distribution Portal Package using Package Manager
In the Unity Editor, open the Package Manager and install the Unity Distribution Portal package.
Open Unity Editor and go to the "Window" menu.
Select "Package Manager".
Search for "Unity Distribution Portal" in the search bar.
Click the "Install" button to install the package and import the sample project.
Step 8: Linking to Project and Game
In the Unity Editor, link your project and game to the UDP project and game by following the prompts in the UDP window.
Go to the "Edit" menu and select "Project Settings"
Select "Services" and log in if you are not logged in.
Select you have a project and organization and say Link Project or create project Id.
Step 9: Check Linking Operation Success
Verify that the linking operation was successful by checking that the UDP window in the Unity Editor shows your project and game.
Go to the "Window" menu and select "Unity Distribution Portal" then select "Settings". If the information on the screen that opens is the same as the information in the Unity Portal, we have successfully linked the project.
Step 10: Activate In-App Purchasing Service on Unity Editor
In the Unity Editor, activate the In-App Purchasing service by following the prompts in the Services window.
From the Unity Editor menu, select "Edit" and then click "Project Settings".
Scroll down to the "Services" section and click "Unity In-App Purchasing".
Turn the status ON on the right side
Step 11: Add Product and Manage Currencies
In Unity Editor
For Unity Editor versions 2019.4 and below, open the UDP Settings inspector window. For Unity Editor versions 2020.1 and above, open the IAP Catalog window.
In the IAP Catalog section, enter your product information for each IAP product. You need to specify a Product ID, a Product Name, a Product Type (Consumable or Non-consumable), and a Price for each product.
To save an individual IAP product to the UDP console, select Push in the drop-down next to the product or if you want all configs to send to the server click on the "Push" button.
To add more products, select Add new IAP Product.
On Unity Distribution Portal
Select EDIT INFO on the Game Information page.
Select Add Item to create a new item.
Specify and save your product information. Follow the requirements for Product IDs to ensure they’re valid for app stores. Make sure the IAP products you define in your game use the same Product ID that is set in the IAP Catalog.
Select Manage amounts and currencies to convert the IAP price from USD to foreign currencies and adjust pricing in these currencies.
You can also use the Bulk IAP Import feature to create multiple IAP items at once, including localized descriptions and pricing in multiple currencies.
Step 12: Create Keystore File for Android
If you are building your game for Android, create a keystore file by following the Android documentation.
Select EDIT INFO on the Game Information page.
Scroll bottom to App Signature and download PEPK tool.
Let’s press the KeyStore Manager button. You select KeyStore… > Create New > AnyWhere or other location. Then create keystore.
We create an output zip file using our keystore file as in the image below.
We return to the Game Information page and upload our zip file in the App Signature field.
Step 13: Build & Test
Build your game and test the In-App Purchasing integration in the Unity Editor.
If you successfully complete the test process, your test process will appear as successfully completed on the Unity Portal as in the image below.
Step 14: Login to AG Connect Panel
To release your game on the Huawei AppGallery, you need to have an account on the AG Connect Panel. If you don't have one already, you can create an account here.
Step 15: Create a Project or Use an Existing Project
Create a new project on the AG Connect Panel or use an existing project.
Sign in to AppGallery Connect and click My projects.
Click + to add a project on the displayed page. Enter a project name and click OK.
Add an app to the project, and configure the same package name as that set in your Android project.
Step 16: Add App to Project and Activate In-App Purchase Kit
Add your game to the project on the AG Connect Panel and activate the In-App Purchase Kit.
Your app package name it should end with ".huawei".
Click Add App button to add a new application to your project by filling the required fields such as name, category, and default language.
Select whether your app is developed for Android or iOS. If you select Android, you need to enter the package name of your app. If you select iOS, you need to enter the bundle ID of your app.
Click the Manage APIs tab and toggle on the switch for In-App Purchases.
Step 17: Connect Huawei AppGallery to UDP
In the UDP console, connect your game to the Huawei AppGallery by following the prompts.
Step 18: Fill in the Game Information and Upload the APK File
In the AG Connect Panel, fill in the game information and upload the APK file.
After successfully completing the linking process, we go to Game Info and fill in all the fields in Game Description. These fields will then match the required fields in the store and automatically fill in the store information.
Then we upload the APK/ABB file that we received 64-bit build on the Unity Editor to the Binary section as in the image below.
Step 19: Release the Game for Repack Mod and Test
Release your game for repacking mod and test the In-App Purchasing integration on a Huawei device.
We go to the Publish section and then select Repack game on the right side. The purpose of this is to download the repackaged Apk first and test if it works correctly.
You can test your game on your own device or if you prefer, you can select a Huawei phone and test your game in the Cloud Debugging section in AppGallery Connect as in the image below.
Step 20: Publish the Game on UDP and Wait for Live Status on AppGallery Store
Finally, publish your game on UDP and wait for it to be approved for release on the Huawei AppGallery store.
We select Repack game and submit it to the store in Huawei AppGallery via Unity Distribution Portal (UDP) and then Publish.
When submitting your game to the Huawei AppGallery, make sure you complete the four steps in the Status tab. After that, it usually takes about one business day for the Store Review section to complete its review. If there are any errors, the Huawei team will notify you of the necessary changes to be made.
If the live light is green, you can now access your app through AppGallery, congratulations! You have successfully integrated UDP IAP into your Unity game and released it on the Huawei AppGallery store.
Thank you for reading this far. Please don't forget to star our github repo 😄
Last updated