User Account Management (iOS)

Last Updated on : 2024-05-31 02:17:50download

Tuya Cube 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 ThingSmartUser 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 ThingRegType The type of registration.