Version: 1.3
语言 : 中文
Getting Started and Settings
IAP Service

Account & Game Service

The Account & Game Service provides a simple and secure login authorization function, which allows users to log in quickly. In the application with Account & Game Service, Users do not need to enter their account number, password, or go through tedious verification. They can quickly log in and use App immediately.

For more information, you can click the following link to reach directly:

Account & Game Service config

To integrate with account and game service:

  1. Open the OpenHarmonySDKKitsSettings window.

  2. Fill in the common configuration include client_id, app_id, Bundle Name.

  3. Check the Account & Game Kit.

  4. Click on Open Scene to open the demo scene with the interface integrated, and operate each function in the scene.

  5. If you want the application to integrate this service when it starts, please check Init On Start.

    Check the Account & Game Kit

Account & Game Service demo scene

To open the Account & Game Service demo scene in the Tuanjie Editor: OpenHarmonySDKKits > OpenHarmonySDKKitsSettings > Account Kit > Open Scene.

Account Scene
Account Scene

The Account & Game Service scene is divided into two parts: Accout & GameService and Game Performance.

Accout & GameService

The functions of Accout & GameService and their calling interfaces are as follows:

Area Description
Init GameService Click to call the init interface of Game Service Kit to initialize the game service.
Log In Click to call the unionLogin interface for joint login, and a secondary window will pop up asking for login method. After successful login, the obtained player ID, needBinding, accountName and other information are returned.
Log Out Click to subscribe and trigger the logout event.
Bind Player Click to call bindPlayer interface to bind the player ID to the game official account and report the binding result.
Verify Player Click to call the verifyLocalPlayer API to perform compliance verification. Account service will verify the real-name authentication of the current device and the game anti-addiction control status. If the verification fails, the corresponding error code will be returned.
Save Player Info After the compliance check is successful, when the player creates a character, click to call savePlayerRole to report the player’s character information.
Output Log The relevant log will be displayed here.

Game Performance

The functions of Game Performance and their calling interfaces are as follows:

Area Description
Init Click to call the init interface to initialize the game scene perception.
Get Device Info Click to call the on interface to subscribe to device status change events to get notifications of device status changes (such as device temperature control level).
Update Game Info Click to call the updateGameInfo interface to report game information
Output Log The relevant log will be displayed here.

Export and build

To run the demo on the OpenHarmony devices:

  1. Open the OpenHarmonySDKKitsSettings window.
  2. Make sure client_id, app_id and Bundle Name have been filled correctly. Make sure Account Kit have been checked.
  3. Open the Build Settings window.
  4. Switch to OpenHarmony platform and check Export Project.
  5. Export project.
  6. Open the exported project in DevEco, build and run on OpenHarmony device.
Getting Started and Settings
IAP Service