Search Unity

Xiaomi developer quick start guide

Overview

This guide is intended for developers to quickly build and deploy apps for the Xiaomi Mi app Center platform. Note that guide glosses over some topics. The following resources are highly recommended for additional detail:

The publishing process for the Mi appCenter with Unity has four major steps, explained below.

  • Build your app for Xiaomi
  • Push your app to Xiaomi
  • Configure your app on Xiaomi’s dev portal
  • Create a production build and launch

Build your app for Xiaomi

First, add the Unity Channel SDK for Xiaomi to your Project:

If your app uses in-app purchases, enabling Unity IAP and installing its components will install the necessary SDK (see section on Using In-App Purchasing below).

If your app does not use in-app purchases, download the standalone SDK:

  • For Unity 2017.1, download the Unity Xiaomi package from the Unity Asset Store and add it to your Project (in the Unity Editor, select Assets > Import Package > Custom Package and specify the Asset package’s file location).
  • For Unity 2017.2, install the standalone SDK from the Build Settings window (File > Build Settings) by selecting Android from the Platform menu and selecting Add from the Xiaomi Game Center menu option that appears.

This SDK provides access to the Mi appCenter and enables certain other Unity services with Xiaomi.

Next, add app store settings for your build using Unity Channel’s AppStoreSettings interface Asset:
  • In the Editor, select Assets > Create > App Store Settings.
  • Select the Asset to view its Inspector, then select Generate Unity Client to populate credentials Xiaomi will need for client-to-server communications.
  • Check the Test Mode box to enable test mode (required for IAP integration testing and Xiaomi submission).
  • Select Save All Settings to save this data to Unity’s servers.

Note: This Asset is only available for Unity 5.6+. If you’re using Unity 5.3 or 5.4, you can access these settings here.

Build your app using one of two methods:
  • Create a local Android APK build (in the Editor, File > Build Settings… > Android > Build; see documentation on building for Android).
  • Use Unity Cloud Build to configure and upload your Project with an Android build target.

Push your app to Xiaomi

On the Unity Developer Dashboard, navigate to your Project, then select Cloud Build > History from the left navbar.

If you built your app locally, select Upload, then select your APK file to upload. If you built your app using Unity Cloud Build, you do not need to upload your build.

Identify the build you wish to to push to Xiaomi, then select Push To Xiaomi to send it to Xiaomi.

Configure your app on Xiaomi’s dev portal

Log in to Xiaomi's developer portal with your UDN credentials. First-time users must acknowledge Xiaomi’s Terms and Conditions. After logging in, any apps you’ve pushed through the Unity Developer Dashboard appear on your Projects list.

Select your newly submitted app to expand its details, then enter the required information and select Submit.

Xiaomi will review your app, then approve or reject the submission based on whether it meets store and country compliance rules. If Xiaomi requires changes, implement its feedback and resubmit as needed.

If your app uses IAP, Xiaomi provides App ID, App Key, and App Secret credentials upon approval. These values are displayed when you select an approved Project on the developer portal. You’ll need them to submit a production build in the next step.

Create a production build and launch on the Mi Game Center!

In the Editor, select the AppStoreSettings Asset, then enter your Xiaomi credentials, uncheck the Test Mode box, and select Save All Settings. Your Project is now configured for Xiaomi’s production servers. Create a new build of your app, then push to Xiaomi as before.

After it approves your app, Xiaomi will facilitate the Chinese government approval process for a publishing license (for more information, see the Submitting to Xiaomi section of the Xiaomi integration documentation). Xiaomi will notify you when the app is licensed and ready to go live on the Mi Game Center!

Using IAP

To use Unity IAP, you must first enable the service.

Configure your Product catalog through the IAP GUI (Window > Unity IAP > IAP Catalog).

Export your catalog from the GUI by selecting App Store Export > Xiaomi Mi Pay Catalog, and saving the resulting MiGameProductCatalog.prop file to your location of choice.

Note: Building your app in test mode will also save a copy of this file to your Project folder.

Follow these steps to upload your IAP Product catalog on the Xiaomi developer portal:
  • On the developer portal, select your Project, then select IAP Configuration from the left navbar.
  • Select Import, then select the MiGameProductCatalog.prop file that’s generated in your Project folder when you build in test mode (more more information, see the section on Using IAP, below).
  • After importing your catalog, confirm the values shown on the dashboard.

For more information on Product configuration, click here. For detailed instructions on Unity IAP implementation for Xiaomi, click here.

Note that Unity IAP must be initialized. The Xiaomi integration guide contains a full code sample for how to achieve this with Xiaomi.

Using Unity Analytics

The Xiaomi network supports Unity Analytics.

To learn more, see documentation on Unity Analytics.

Got it

We use cookies to ensure that we give you the best experience on our website. Click here for more information.