English
English
简体中文
Contact Us
Register
Log In
layoutIndex

User Account Management (iOS)

Last Updated on : 2021-07-21 01:43:57download

Tuya Smart Life 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 also supports two login methods: verification code login and password login.
  • An app UID applies to existing account systems.
  • Third-party login supports login with an authorized account of a third-party platform, such as Facebook and Twitter.
  • Anonymous login provides a quick login method. Anonymous users can provide detailed user information to get a registered account.

Functional description

In this module, the TuyaSmartUser object is frequently called. This object is a singleton that stores all information about 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 of the user.
countryCode NSString The country code. Valid values:
  • 86: China
  • 1: United States
regionCode NSString The availability zone to which the current account belongs. Valid values:
  • AY: China
  • AZ: America
  • 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 sign-in status.
regFrom TYRegType The type of registration.