Last Updated on : 2023-05-22 06:38:22
Tuya Smart Life App SDK supports multiple types of user accounts, such as mobile phone numbers, email addresses, and app UIDs.
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 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.
To implement registration methods, you must set the countryCode
parameter to specify the country code. This way, the data center closest to users’ location can be selected to serve workloads in the Tuya IoT Cloud.
The data in different data centers is isolated from each other. For example, an account that is registered in America (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 center.
In this tutorial, 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.
|
mobile | The mobile phone number. |
The email address of the user. | |
phoneCode | The country code. Example:
|
Domain.regionCode | The data center to which the current account belongs. Example:
|
timezoneId | The time zone ID. Example: Asia/Shanghai . |
tempUnit | The temperature unit. Valid values:
|
snsNickname | The nickname of a third-party account. |
regFrom | The type of registration. Valid values:
|
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback