HarmonyOS Native SDK
User Account
Anonymous Account

Anonymous Account

Anonymous login

Without an argument, the SDK uses its persisted installation identifier:

const userManager = GizSDKManager.getUserManager();
await userManager.loginByAnonymous();

The calling app may provide its own stable phoneId:

await userManager.loginByAnonymous('stable-installation-id');

Anonymous accounts are associated with the installation identifier. Do not generate a new random value on every launch, because that can create multiple anonymous users.