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:
To integrate with account and game service:
Open the OpenHarmonySDKKitsSettings window.
Fill in the common configuration include client_id
, app_id
, Bundle Name
.
Check the Account & Game Kit.
Click on Open Scene
to open the demo scene with the interface integrated, and operate each function in the scene.
If you want the application to integrate this service when it starts, please check Init On Start
.
To open the Account & Game Service demo scene in the Tuanjie Editor: OpenHarmonySDKKits > OpenHarmonySDKKitsSettings > Account Kit > Open Scene.
The Account & Game Service scene is divided into two parts: Accout & GameService and Game Performance.
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. |
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. |
To run the demo on the OpenHarmony devices:
client_id
, app_id
and Bundle Name
have been filled correctly. Make sure Account Kit have been checked.