User Account Management

Last Updated on : 2023-06-04 23:48:10download

Tuya Smart Residence App SDK supports user accounts that are registered with email addresses.

Functional description

In this module, the TuyaSmartUser 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 an email address, the username is an email address.
headIconUrl NSString The URL of the user avatar.
nickname NSString The nickname of a specified user.
phoneNumber NSString The mobile phone number of the user.
email NSString The email address of the user.
countryCode NSString The country code. Example:
  • 1: United States
  • 55: Brazil
regionCode NSString The data center to which the current account belongs. Example:
  • 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)
isLogin BOOL The login status.
regFrom TYRegType The type of registration.

Account roles

Site members can be assigned the following roles:

  • Owner: granted all permissions on specific sites and devices.
  • Administrator: granted most permissions on specific sites and devices.
  • Member: only authorized to use devices, but cannot manage common members.

Their permission levels are sorted in the following descending order: owner > administrator > member.