HarmonyOS Native SDK
Device Management
Bind Device

Bind a Device

Binding requires an authenticated user. Choose one entry point based on the device data already available; do not call multiple binding methods for one operation.

Bind a discovered device

await device.bind('Living room device', 'First floor');

You can also bind by MAC address and ProductKey through the user manager:

await userManager.bindDevice(device.mac, device.productKey, 'Living room device', 'First floor');

Bind with Device ID and Passcode

await userManager.bindDeviceWithPasscode(deviceId, passcode);

After success, the SDK refreshes the bound-device list and reuses the GizDevice in the unified cache. Catch Promise errors and present an actionable ArkUI message.