User Account Management

Last Updated on : 2024-03-20 09:03:22download

Commercial Lock App SDK supports multiple types of user accounts, such as mobile phone numbers, email addresses, and app UIDs.

Account types

Different types of accounts support the following specific capabilities:

  • An account that is registered with a mobile phone number supports two login methods: verification code login and password login.
  • An account that is registered with an email address supports two login methods: verification code login and password login.
  • An app UID applies to existing account systems.

Features

  • The user registration method requires the countryCode parameter to specify the country code, enabling the selection of the nearest data center based on the users’ location.

    The data in different data centers is isolated from each other. For example, an account that is registered in the United States (1) cannot be used in mainland China (86). Otherwise, an error message is returned to indicate that the account does not exist. For more information, see Data Centers.

  • In this module, the User object is frequently called. This object is a singleton that stores all data of the current user, including login and registration methods. The following table describes the data model of the object.

    Field Description
    headPic The URL of the user avatar.
    nickName The nickname of the user.
    username The username.
    • If an account is registered with a mobile phone number, the username is a mobile phone number.
    • If an account is registered with an email address, the username is an email address.
    mobile The mobile phone number.
    email The email address.
    phoneCode The country code. Valid values:
    • 86: China
    • 1: United States
    Domain.regionCode The data center to which the current account belongs. Valid values:
    • AY: China
    • AZ: United States
    • EU: Europe
    timezoneId The time zone ID. Example: Asia/Shanghai.
    tempUnit The temperature unit. Valid values:
    • 1: Temperature in Celsius (°C)
    • 2: Temperature in Fahrenheit (°F)
    snsNickname The nickname of a third-party account.
    regFrom The type of registration. Valid values:
    • 0: Email address
    • 1: Mobile phone number