User Account Management

Last Updated on : 2024-03-21 03:29:28download

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 your existing account systems.

Features

In this module, the ThingSmartUser 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 Type Description
userName NSString 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.
headIconUrl NSString The URL of the user avatar.
nickname NSString The nickname of the user.
phoneNumber NSString The mobile phone number of the user.
email NSString The email address.
countryCode NSString The country code. Valid values:
  • 86: China
  • 1: United States
regionCode NSString The data center to which the current account belongs. Valid values:
  • AY: China
  • AZ: United States
  • EU: Europe
timezoneId NSString The time zone ID. Example: Asia/Shanghai.
tempUnit NSInteger The temperature unit. Valid values:
  • 1: Temperature in Celsius (°C)
  • 2: Temperature in Fahrenheit (°F)
snsNickname NSString The nickname of a third-party account.
isLogin BOOL The login status.
regFrom ThingRegType The type of registration. Valid values:
  • 0: Email address
  • 1: Mobile phone number