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

Log in as a user

Last Updated on : 2022-01-07 07:03:31

The TYUserManager class provides the API method to enable login and keep sessions.

Currently, the SDK does not support user registration. All registration steps are completed on the Tuya IoT Development Platform. You must manually add users to your project before the users can log in to the app and access your project. For more information, see Manage Users.

Parameters

Parameter Data type Required Description
userName String true The username.
password String true The password.

Example

TYUserManager().login(userName: "userName", password: "password") { (success, error) in
    if success {
       
        } else {

       }
    }
}