Access to Huawei HMS Game service based on Cocos SDKHub—Access SDKHub

Create a game in the Cocos console

Create a game at https://account.cocos.com/#/game/game_list and just create it as required.

Insert picture description here

Create a game in Huawei AppGallery Connect and configure related information

  1. Create a project in AppGallery Connect and create an application under the project to complete the creation of the application. Choose Android for the platform, select the mobile phone for the device, and select the application or game by category.

  2. Configure the fingerprint of the signature certificate: In the "Application" area of ​​the "Project Settings> General" page, click the icon behind the "SHA256 certificate fingerprint", and enter the generated SHA256 fingerprint.

  3. In "My Project"> "Project Settings> "API Management", turn on the required switch. For payment, you need to select "Profit> In-App Payment Service" and click "Settings".

  4. Configure achievements and events (if needed): For detailed information, please refer to the official documentation to configure achievements and events.

Open the Cocos creator project and associate the game created by the Cocos console

Associate the created game under the service. Select Set Cocos AppID, select the corresponding game, and click Link.
Insert picture description here
Insert picture description here
Insert picture description here

Open SDKHub service

Insert picture description here
After opening the SDKHub service, in the developer tools, try to enter the sdkhub command to associate with related interfaces and functions.
Insert picture description here

Configure SDKHub

  1. Configure the plug-in: Click the button in the figure below, check the Huawei service that needs to be activated, and click OK.
    Insert picture description here

  2. Configure parameters: Click the button below to configure the parameters in the pop-up window.
    Insert picture description here
    Insert picture description here

The payment public key can be viewed and obtained by selecting "Profit> In-app Payment Service", and the "public key" is the payment public key.
Insert picture description here

At this point, SDKHub is integrated, and you can directly develop in the Cocos development environment later!

The next section will introduce how to package and publish to Huawei AppGellery Connect.

For more details, please see:

How to create an application on AGC:https://developer.huawei.com/consumer/cn/doc/distribution/app/agc-create_app

Cocos SDKHub quick start:https://docs.cocos.com/creator/manual/zh/cocos-service/sdkhub.html


Original link:https://developer.huawei.com/consumer/cn/forum/topic/0204388296044900043?fid=18
Author: Drum Chao

Guess you like

Origin blog.51cto.com/14772288/2544729