TuyaSmartUser Class Reference

Inherits from NSObject
Declared in TuyaSmartUser.h

Overview

User-related functions. 用户相关功能

We don’t link WatchConnectivity.framework because not all developers need this feature. If the sdk links WatchConnectivity.framework and don’t use this feature, your app might be reject when submit to Apple Store. So please link WatchConnectivity.framework manually and use it on demand.

Other Methods

+ sharedInstance

Singleton

+ (instancetype)sharedInstance

Discussion

Singleton

Declared In

TuyaSmartUser.h

  sid

Session ID

@property (nonatomic, strong, readonly) NSString *sid

Discussion

Session ID

Declared In

TuyaSmartUser.h

  uid

User ID

@property (nonatomic, strong, readonly) NSString *uid

Discussion

User ID

Declared In

TuyaSmartUser.h

  headIconUrl

Head icon

@property (nonatomic, strong, readonly) NSString *headIconUrl

Discussion

Head icon

Declared In

TuyaSmartUser.h

  nickname

Nick name

@property (nonatomic, strong, readonly) NSString *nickname

Discussion

Nick name

Declared In

TuyaSmartUser.h

  userName

Username. If account is mobile phone, this is mobile phone. If account is email, this is email. 用户名。如果主账号是手机号,userName就是手机号.如果主账号是邮箱,userName就是邮箱。

@property (nonatomic, strong, readonly) NSString *userName

Discussion

Username. If account is mobile phone, this is mobile phone. If account is email, this is email. 用户名。如果主账号是手机号,userName就是手机号.如果主账号是邮箱,userName就是邮箱。

Declared In

TuyaSmartUser.h

  phoneNumber

Mobile phone

@property (nonatomic, strong, readonly) NSString *phoneNumber

Discussion

Mobile phone

Declared In

TuyaSmartUser.h

  email

Email

@property (nonatomic, strong, readonly) NSString *email

Discussion

Email

Declared In

TuyaSmartUser.h

  countryCode

Country code. 86 for China, 1 for America. 国家区号。86:中国,1:美国。

@property (nonatomic, strong, readonly) NSString *countryCode

Discussion

Country code. 86 for China, 1 for America. 国家区号。86:中国,1:美国。

Declared In

TuyaSmartUser.h

  isLogin

Login state

@property (nonatomic, assign, readonly) BOOL isLogin

Discussion

Login state

Declared In

TuyaSmartUser.h

  regionCode

The region code of current account. AY for China, AZ for America, EU for Europe. 当前账号所在的国家区域。AY:中国,AZ:美国,EU:欧洲。

@property (nonatomic, strong, readonly) NSString *regionCode

Discussion

The region code of current account. AY for China, AZ for America, EU for Europe. 当前账号所在的国家区域。AY:中国,AZ:美国,EU:欧洲。

Declared In

TuyaSmartUser.h

  domain

The api domains of current account region. 当前账号所在区域的接口域名地址

@property (nonatomic, strong, readonly) NSDictionary *domain

Discussion

The api domains of current account region. 当前账号所在区域的接口域名地址

Declared In

TuyaSmartUser.h

  timezoneId

Timezone ID. e.g. Asia/Shanghai. 用户时区信息

@property (nonatomic, strong, readonly) NSString *timezoneId

Discussion

Timezone ID. e.g. Asia/Shanghai. 用户时区信息

Declared In

TuyaSmartUser.h

  partnerIdentity

@property (nonatomic, strong, readonly) NSString *partnerIdentity

  mbHost

mqtt host mqtt 域名

@property (nonatomic, strong, readonly) NSString *mbHost

Discussion

mqtt host mqtt 域名

Declared In

TuyaSmartUser.h

  gwHost

@property (nonatomic, strong, readonly) NSString *gwHost

  port

mqtt port mqtt 端口号

@property (nonatomic, assign, readonly) NSInteger port

Discussion

mqtt port mqtt 端口号

Declared In

TuyaSmartUser.h

  useSSL

SSL 是否开启SSL

@property (nonatomic, assign, readonly) BOOL useSSL

Discussion

SSL 是否开启SSL

Declared In

TuyaSmartUser.h

  tempUnit

Temperature unit. 1 for °C, 2 for °F. 温度单位。1:°C, 2:°F

@property (nonatomic, assign) NSInteger tempUnit

Discussion

Temperature unit. 1 for °C, 2 for °F. 温度单位。1:°C, 2:°F

Declared In

TuyaSmartUser.h

  regFrom

User register type 账号注册的类型

@property (nonatomic, assign, readonly) TYRegType regFrom

Discussion

User register type 账号注册的类型

Declared In

TuyaSmartUser.h

  snsNickname

Nickname of sns account. 第三方账号的昵称

@property (nonatomic, strong, readonly) NSString *snsNickname

Discussion

Nickname of sns account. 第三方账号的昵称

Declared In

TuyaSmartUser.h

  ecode

@property (nonatomic, strong, readonly) NSString *ecode

– sendVerifyCode:phoneNumber:type:success:failure:

Send verification code. Used for mobile phone verification code login, register, password reset. 发送验证码,用于手机验证码登录/注册,手机密码重置。

- (void)sendVerifyCode:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber type:(NSInteger)type success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

type

0: mobile phone verification code login, 1: mobile phone verification code register, 2: mobile phone password reset.

success

Success block

failure

Failure block

Discussion

Send verification code. Used for mobile phone verification code login, register, password reset. 发送验证码,用于手机验证码登录/注册,手机密码重置。

Declared In

TuyaSmartUser.h

– loginWithMobile:countryCode:code:success:failure:

Modile phone verification code login. 手机验证码登录

- (void)loginWithMobile:(NSString *)mobile countryCode:(NSString *)countryCode code:(NSString *)code success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

mobile

Mobile phone number

countryCode

Country code

code

Verification code

success

Success block

failure

Failure block

Discussion

Modile phone verification code login. 手机验证码登录

Declared In

TuyaSmartUser.h

– sendBindVerifyCode:phoneNumber:success:failure:

Send verification code. Used for mobile phone bind, mobile phone change. 发送验证码,用于手机验证码绑定手机号,更换手机号。

- (void)sendBindVerifyCode:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

success

Success block

failure

Failure block

Discussion

Send verification code. Used for mobile phone bind, mobile phone change. 发送验证码,用于手机验证码绑定手机号,更换手机号。

Declared In

TuyaSmartUser.h

– mobileBinding:phoneNumber:code:success:failure:

Mobile phone bind. 手机绑定

- (void)mobileBinding:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

code

Verification code

success

Success block

failure

Failure block

Discussion

Mobile phone bind. 手机绑定

Declared In

TuyaSmartUser.h

– registerByPhone:phoneNumber:password:code:success:failure:

Mobile phone register. 手机注册

- (void)registerByPhone:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber password:(NSString *)password code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

password

Password

code

Verification code

success

Success block

failure

Failure block

Discussion

Mobile phone register. 手机注册

Declared In

TuyaSmartUser.h

– loginByPhone:phoneNumber:password:success:failure:

Mobile phone password login. 手机密码登录

- (void)loginByPhone:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber password:(NSString *)password success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

password

Password

success

Success block

failure

Failure block

Discussion

Mobile phone password login. 手机密码登录

Declared In

TuyaSmartUser.h

– resetPasswordByPhone:phoneNumber:newPassword:code:success:failure:

Mobile phone password reset. 手机密码重置

- (void)resetPasswordByPhone:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber newPassword:(NSString *)newPassword code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

newPassword

New password

code

Verification code

success

Success block

failure

Failure block

Discussion

Mobile phone password reset. 手机密码重置

Declared In

TuyaSmartUser.h

– loginByEmail:email:password:success:failure:

Email login. 邮箱登录

- (void)loginByEmail:(NSString *)countryCode email:(NSString *)email password:(NSString *)password success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

password

Password

success

Success block

failure

Failure block

Discussion

Email login. 邮箱登录

Declared In

TuyaSmartUser.h

– sendVerifyCodeByEmail:email:success:failure:

Send verification code, used for email password reset. 发送验证码,用于邮箱密码重置

- (void)sendVerifyCodeByEmail:(NSString *)countryCode email:(NSString *)email success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

success

Success block

failure

Failure block

Discussion

Send verification code, used for email password reset. 发送验证码,用于邮箱密码重置

Declared In

TuyaSmartUser.h

– resetPasswordByEmail:email:newPassword:code:success:failure:

Email password reset. 邮箱密码重置

- (void)resetPasswordByEmail:(NSString *)countryCode email:(NSString *)email newPassword:(NSString *)newPassword code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

newPassword

New password

code

Verification code

success

Success block

failure

Failure block

Discussion

Email password reset. 邮箱密码重置

Declared In

TuyaSmartUser.h

– sendVerifyCodeByRegisterEmail:email:success:failure:

Send verification code, used for email password register. 发送验证码,用于邮箱注册

- (void)sendVerifyCodeByRegisterEmail:(NSString *)countryCode email:(NSString *)email success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

success

Success block

failure

Failure block

Discussion

Send verification code, used for email password register. 发送验证码,用于邮箱注册

Declared In

TuyaSmartUser.h

– registerByEmail:email:password:code:success:failure:

Email register 2.0. 邮箱注册 2.0

- (void)registerByEmail:(NSString *)countryCode email:(NSString *)email password:(NSString *)password code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

password

Password

code

Verification code

success

Success block

failure

Failure block

Discussion

Email register 2.0. 邮箱注册 2.0

Declared In

TuyaSmartUser.h

– loginWithEmail:countryCode:code:success:failure:

Email verification code login. 邮箱验证码登录

- (void)loginWithEmail:(NSString *)email countryCode:(NSString *)countryCode code:(NSString *)code success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

email

Email

countryCode

Country code

code

Verification code

success

Success block

failure

Failure block

Discussion

Email verification code login. 邮箱验证码登录

Declared In

TuyaSmartUser.h

– loginOrRegisterWithCountryCode:uid:password:createHome:success:failure:

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

- (void)loginOrRegisterWithCountryCode:(NSString *)countryCode uid:(NSString *)uid password:(NSString *)password createHome:(BOOL)createHome success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

uid

User ID

password

Password

createHome

Create default home

success

Success block

failure

Failure block

Discussion

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

Declared In

TuyaSmartUser.h

– loginByQQ:userId:accessToken:success:failure:

QQ login. QQ登录

- (void)loginByQQ:(NSString *)countryCode userId:(NSString *)userId accessToken:(NSString *)accessToken success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

userId

userId from QQ authorization login

accessToken

accessToken from QQ authorization login

success

Success block

failure

Failure block

Discussion

QQ login. QQ登录

Declared In

TuyaSmartUser.h

– loginByWechat:code:success:failure:

Wechat login. 微信登录

- (void)loginByWechat:(NSString *)countryCode code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

code

code from Wechat authorization login

success

Success block

failure

Failure block

Discussion

Wechat login. 微信登录

Declared In

TuyaSmartUser.h

– loginByFacebook:token:success:failure:

Facebook Login. Facebook登录

- (void)loginByFacebook:(NSString *)countryCode token:(NSString *)token success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

token

token from Facebook authorization login

success

Success block

failure

Failure block

Discussion

Facebook Login. Facebook登录

Declared In

TuyaSmartUser.h

– loginByTwitter:key:secret:success:failure:

Twitter login. Twitter登录

- (void)loginByTwitter:(NSString *)countryCode key:(NSString *)key secret:(NSString *)secret success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

key

key from Twitter authorization login

secret

secret from Twitter authorization login

success

Success block

failure

Failure block

Discussion

Twitter login. Twitter登录

Declared In

TuyaSmartUser.h

– loginByAuth2WithType:countryCode:accessToken:extraInfo:success:failure:

third login.

- (void)loginByAuth2WithType:(NSString *)type countryCode:(NSString *)countryCode accessToken:(NSString *)accessToken extraInfo:(NSDictionary *)extraInfo success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

type

login type(ap for “login with apple”)

countryCode

countryCode

accessToken

token from third authorization login

extraInfo

extra params

success

Success block

failure

Failure block

Discussion

third login.

Declared In

TuyaSmartUser.h

– loginOut:failure:

Logout. 登出

- (void)loginOut:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Logout. 登出

Declared In

TuyaSmartUser.h

– updateNickname:success:failure:

Edit nick name. 修改昵称

- (void)updateNickname:(NSString *)nickName success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

nickName

Nick name

success

Success block

failure

Failure block

Discussion

Edit nick name. 修改昵称

Declared In

TuyaSmartUser.h

– updateHeadIcon:success:failure:

Edit head icon. 修改头像

- (void)updateHeadIcon:(UIImage *)headIcon success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

headIcon

Head icon

success

Success block

failure

Failure block

Discussion

Edit head icon. 修改头像

Declared In

TuyaSmartUser.h

– updateUserInfo:failure:

Update user information. 更新用户信息

- (void)updateUserInfo:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Update user information. 更新用户信息

Declared In

TuyaSmartUser.h

– updateTimeZoneWithTimeZoneId:success:failure:

Edit user timezone information. 更新用户时区

- (void)updateTimeZoneWithTimeZoneId:(NSString *)timeZoneId success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

timeZoneId

TimeZone ID. e.g. Asia/Shanghai.

success

Success block

failure

Failure block

Discussion

Edit user timezone information. 更新用户时区

Declared In

TuyaSmartUser.h

– updateTempUnitWithTempUnit:success:failure:

Edit user temperature unit 更新用户温度单位

- (void)updateTempUnitWithTempUnit:(NSInteger)tempUnit success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

tempUnit

Temperature unit. 1 for °C, 2 for °F.

success

Success block

failure

Failure block

Discussion

Edit user temperature unit 更新用户温度单位

Declared In

TuyaSmartUser.h

– cancelAccount:failure:

Destory account. One week after, all of the account information will be removed from server forever. If you login before removed, the destory request will be canceled. 停用帐号(注销用户) 一周后账号才会永久停用并删除以下你账户中的所有信息,在此之前重新登录,则你的停用请求将被取消

- (void)cancelAccount:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Destory account. One week after, all of the account information will be removed from server forever. If you login before removed, the destory request will be canceled. 停用帐号(注销用户) 一周后账号才会永久停用并删除以下你账户中的所有信息,在此之前重新登录,则你的停用请求将被取消

Declared In

TuyaSmartUser.h

– cancelRequest

Cancel network request

- (void)cancelRequest

Discussion

Cancel network request

Declared In

TuyaSmartUser.h

LoginByQRCode Methods

– loginByQRcode:success:failure:

Authorize third-party applications to login by QR code. 授权第三方应用登录

- (void)loginByQRcode:(NSDictionary *)codeInfo success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

codeInfo

QR code information

success

Success block

failure

Failure block

Discussion

Authorize third-party applications to login by QR code. 授权第三方应用登录

Declared In

TuyaSmartUser+LoginByQRCode.h

– userInfo:success:failure:

Get third-party applications info. 获取第三方应用信息

- (void)userInfo:(NSDictionary *)codeInfo success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

codeInfo

QR code information

success

Success block

failure

Failure block

Discussion

Get third-party applications info. 获取第三方应用信息

Declared In

TuyaSmartUser+LoginByQRCode.h

Region Methods

– regionListWithCountryCode:success:failure:

Get region list. 获取区域列表

- (void)regionListWithCountryCode:(NSString *)countryCode success:(void ( ^ ) ( NSArray<TYRegionModel*> *regionList ))success failure:(TYFailureError)failure

Parameters

countryCode

Country code

success

Success block

failure

Failure block

Discussion

Get region list. 获取区域列表

Declared In

TuyaSmartUser+Region.h

– getDefaultRegionWithCountryCode:

Get degault region of the country code.AY for China, AZ for America, EU for Europe. 获取国家码对应的默认地区, AY:中国,AZ:美国,EU:欧洲。

- (NSString *)getDefaultRegionWithCountryCode:(NSString *)countryCode

Parameters

countryCode

Country code

Return Value

return a default region of the country code.

Discussion

Get degault region of the country code.AY for China, AZ for America, EU for Europe. 获取国家码对应的默认地区, AY:中国,AZ:美国,EU:欧洲。

Declared In

TuyaSmartUser+Region.h

– getDefaultDomain

Get default domain. 获取默认域名

- (NSDictionary *)getDefaultDomain

Return Value

return a default region of the country code.

Discussion

Get default domain. 获取默认域名

MQTT: mobileMqttsUrl API: mobileApiUrl

Declared In

TuyaSmartUser+Region.h

– sendVerifyCodeWithUserName:region:countryCode:type:success:failure:

Send verification code, used for register/login/reset password. 发送验证码,用于注册、登录、重设密码

- (void)sendVerifyCodeWithUserName:(NSString *)userName region:(NSString *_Nullable)region countryCode:(NSString *)countryCode type:(NSInteger)type success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

userName

Mobile phone number or Email address

region

for register is required, use [TuyaSmartUser regionListWithCountryCode:success:failure:] or [TuyaSmartUser getDefaultRegionWithCountryCode:] to get region

countryCode

Country code

type

1: mobile phone verification code register, 2: mobile phone verification code login, 3: mobile phone password reset.

success

Success block

failure

Failure block

Discussion

Send verification code, used for register/login/reset password. 发送验证码,用于注册、登录、重设密码

Declared In

TuyaSmartUser+Region.h

– checkCodeWithUserName:region:countryCode:code:type:success:failure:

Check verification code, used for register/login/reset password. 验证验证码,用于注册、登录、重设密码

- (void)checkCodeWithUserName:(NSString *)userName region:(NSString *_Nullable)region countryCode:(NSString *)countryCode code:(NSString *)code type:(NSInteger)type success:(TYSuccessBOOL)success failure:(TYFailureError)failure

Parameters

userName

Mobile phone number or Email address

region

for register is required, use [TuyaSmartUser regionListWithCountryCode:success:failure:] or [TuyaSmartUser getDefaultRegionWithCountryCode:] to get region

countryCode

Country code

code

Verification code

type

1: mobile phone verification code register, 2: mobile phone verification code login, 3: mobile phone password reset.

success

Success block

failure

Failure block

Discussion

Check verification code, used for register/login/reset password. 验证验证码,用于注册、登录、重设密码

Declared In

TuyaSmartUser+Region.h

– registerWithUserName:region:countryCode:code:password:success:failure:

Mobile phone & Email register. 手机+邮箱注册

- (void)registerWithUserName:(NSString *)userName region:(NSString *)region countryCode:(NSString *)countryCode code:(NSString *)code password:(NSString *)password success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

userName

Mobile phone number or Email address

region

The region to register account, use [TuyaSmartUser regionListWithCountryCode:success:failure:] or [TuyaSmartUser getDefaultRegionWithCountryCode:] to get region

countryCode

Country code

code

Verification code

password

Password

success

Success block

failure

Failure block

Discussion

Mobile phone & Email register. 手机+邮箱注册

Declared In

TuyaSmartUser+Region.h

– switchUserRegion:success:failure:

Switch the region of logged in user. 切换已登录用户的地区

- (void)switchUserRegion:(NSString *)region success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

region

The region to register account, use [TuyaSmartUser regionListWithCountryCode:success:failure:] or [TuyaSmartUser getDefaultRegionWithCountryCode:] to get region

success

Success block

failure

Failure block

Discussion

Switch the region of logged in user. 切换已登录用户的地区

WARNING: 1. switch user region is same as register a new account to the region of user. becaues of GDPR, switch region will not take user’s device and scene to the new account.Only take user information to the new account. 2. When account switch to the new region, old account only reserved for 30 days.After 30 days, old account will be deleted. 3. If switch region success, new account will be logined.

Declared In

TuyaSmartUser+Region.h

BleMesh Methods

  meshModel

@property (nonatomic, strong) TuyaSmartBleMeshModel *meshModel

  mesh

@property (nonatomic, strong) TuyaSmartBleMesh *mesh

WCSession Methods

– updateApplicationContext:

Sync TuyaSmartUser context to iWatch. When user login/logout/session expired on iPhone, please use this method to sync manually. 同步TuyaSmartUser用户信息到iWatch。当用户在iPhone登录、登出、session过期时,需要手动调用此方法同步。

- (BOOL)updateApplicationContext:(WCSession *)session

Parameters

session

session

Return Value

results of synchron

Discussion

Sync TuyaSmartUser context to iWatch. When user login/logout/session expired on iPhone, please use this method to sync manually. 同步TuyaSmartUser用户信息到iWatch。当用户在iPhone登录、登出、session过期时,需要手动调用此方法同步。

Example:

[TuyaSmartUser.sharedInstance updateApplicationContext:session];

Declared In

TuyaSmartUser+WCSession.h

– didReceiveApplicationContext:

Receive TuyaSmartUser context from iPhone. 从iPhone获取TuyaSmartUser用户信息。

- (void)didReceiveApplicationContext:(NSDictionary *)applicationContext

Parameters

applicationContext

applicationContext

Discussion

Receive TuyaSmartUser context from iPhone. 从iPhone获取TuyaSmartUser用户信息。

Declared In

TuyaSmartUser+WCSession.h

DeprecatedApi Methods

– registerByEmail:email:password:success:failure:

Email register 1.0. 邮箱注册 1.0

- (void)registerByEmail:(NSString *)countryCode email:(NSString *)email password:(NSString *)password success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

email

Email

password

Password

success

Success block

failure

Failure block

Discussion

Email register 1.0. 邮箱注册 1.0

Declared In

TuyaSmartUser+DeprecatedApi.h

– login:phoneNumber:code:success:failure:

Mobile phone verification code login and register. 手机验证码登录和注册

- (void)login:(NSString *)countryCode phoneNumber:(NSString *)phoneNumber code:(NSString *)code success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

phoneNumber

Mobile phone number

code

Verification code

success

Success block

failure

Failure block

Discussion

Mobile phone verification code login and register. 手机验证码登录和注册

Declared In

TuyaSmartUser+DeprecatedApi.h

– loginOrRegisterByPhone:uid:password:success:failure:

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

- (void)loginOrRegisterByPhone:(NSString *)countryCode uid:(NSString *)uid password:(NSString *)password success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

uid

User ID

password

Password

success

Success block

failure

Failure block

Discussion

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

Declared In

TuyaSmartUser+DeprecatedApi.h

– loginOrRegisterByPhone:uid:password:createHome:success:failure:

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

- (void)loginOrRegisterByPhone:(NSString *)countryCode uid:(NSString *)uid password:(NSString *)password createHome:(BOOL)createHome success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

uid

User ID

password

Password

createHome

Create default home

success

Success block

failure

Failure block

Discussion

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录)

Declared In

TuyaSmartUser+DeprecatedApi.h

– registerByUid:password:countryCode:success:failure:

uid register. uid注册

- (void)registerByUid:(NSString *)uid password:(NSString *)password countryCode:(NSString *)countryCode success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

uid

User ID

password

Password

countryCode

Country code

success

Success block

failure

Failure block

Discussion

uid register. uid注册

Declared In

TuyaSmartUser+DeprecatedApi.h

– loginByUid:password:countryCode:success:failure:

uid login. uid登录

- (void)loginByUid:(NSString *)uid password:(NSString *)password countryCode:(NSString *)countryCode success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

uid

User ID

password

Password

countryCode

Country code

success

Success block

failure

Failure block

Discussion

uid login. uid登录

Declared In

TuyaSmartUser+DeprecatedApi.h

– loginOrRegisterWithCountryCode:uid:password:success:failure:

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录),不自动创建家庭

- (void)loginOrRegisterWithCountryCode:(NSString *)countryCode uid:(NSString *)uid password:(NSString *)password success:(nullable TYSuccessHandler)success failure:(nullable TYFailureError)failure

Parameters

countryCode

Country code

uid

User ID

password

Password

success

Success block

failure

Failure block

Discussion

uid login/register. The account will be registered at first login. uid 登录注册接口(如果没有注册就注册,如果注册就登录),不自动创建家庭

Declared In

TuyaSmartUser+DeprecatedApi.h