Integrating HUAWEI Game Service Based on Cocos SDKHub — Integrating Cocos SDKHub

1. Creating a Game on the Cocos Console

Create a game on the Cocos console as instructed (https://account.cocos.com/#/game/game_list).

2. Creating a Game in HUAWEI AppGallery Connect

Step 1: Create a project in AppGallery Connect and add your app to the project.

Set Platform to Android, Device to Mobile phone, and App category to App or Game based on your needs.

Step 2: Configure the signing certificate fingerprint.

Go to Project settings > General information. In the App information area, click the icon next to SHA-256 certificate fingerprint, and enter the obtained SHA-256 certificate fingerprint.

Step 3: Enable the services you need.

Go to My projects > Project settings > Manage APIs, and enable the APIs you need to use.

If your app includes in-app purchases, go to Earn > In-App Purchases, and click Settings to enable HUAWEI IAP.

Step 4: (Optional) Configure achievements and events for your game.

For details, see the official documentation.

3. Associating a Game in Cocos Creator

You can enable third-party services for your app in Cocos Creator. But first, you need to set a Cocos AppID. Select a created game, and click Association, as shown in the following figures.

4. Integrating Cocos SDKHub

After Cocos SDKHub is integrated, you can run the sdkhub command in Developer Tools to access related APIs and functions.

5. Configuring Cocos SDKHub

1. Configuring a plug-in: Click Config Plugin, select the Huawei services to be enabled, and click OK.

2. Setting parameters: Click the following button and set parameters in the dialog box that is displayed.

Obtain the payment public key from Earn > In-App Purchases in AppGallery Connect.

Now that you have integrated Cocos SDKHub, you can develop your game in the Cocos development environment.

Next time, we’ll take a look at how to package and release an app in AppGallery Connect.

For more details, check:

AppGallery Connect documentation:

https://developer.huawei.com/consumer/en/doc/distribution/app/agc-create_app

Cocos SDKHub Quick Start:

https://docs.cocos.com/creator/manual/en/cocos-service/sdkhub.html

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store