TuyaSmartSDK Class Reference

Inherits from NSObject
Declared in TuyaSmartSDK.h

Other Methods

+ sharedInstance

Singleton

+ (instancetype)sharedInstance

Return Value

instance

Discussion

Singleton

Declared In

TuyaSmartSDK.h

  appGroupId

Application group identifier If you want to use the SDK in app extension, set appGroupId before SDK initialized both in app & app extension. 如果需要开发APP Extension,请在初始化SDK的时候设置 appGroupId

@property (nonatomic, strong) NSString *appGroupId

Discussion

Application group identifier If you want to use the SDK in app extension, set appGroupId before SDK initialized both in app & app extension. 如果需要开发APP Extension,请在初始化SDK的时候设置 appGroupId

Declared In

TuyaSmartSDK.h

  latitude

Latitude of the loaction

@property (nonatomic, assign) double latitude

Discussion

Latitude of the loaction

Declared In

TuyaSmartSDK.h

  longitude

Longitude of the loaction

@property (nonatomic, assign) double longitude

Discussion

Longitude of the loaction

Declared In

TuyaSmartSDK.h

  env

Server environment, daily/prepare/release. For test only. Not recommended to switch 测试环境,不建议切换

@property (nonatomic, assign) TYEnv env

Discussion

Server environment, daily/prepare/release. For test only. Not recommended to switch 测试环境,不建议切换

Declared In

TuyaSmartSDK.h

  useSSLPinning

@property (nonatomic, assign) BOOL useSSLPinning

  appKey

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

  secretKey

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

  channel

Channel

@property (nonatomic, strong) NSString *channel

Discussion

Channel

Declared In

TuyaSmartSDK.h

  uuid

uuid of the iOS/watchOS device. Will be created at app first launch.

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

Discussion

uuid of the iOS/watchOS device. Will be created at app first launch.

Declared In

TuyaSmartSDK.h

– startWithAppKey:secretKey:

Initialize TuyaSmart SDK 初始化涂鸦智能SDK

- (void)startWithAppKey:(NSString *)appKey secretKey:(NSString *)secretKey

Parameters

appKey

TuyaSmart AppKey

secretKey

TuyaSmart SecretKey

Discussion

Initialize TuyaSmart SDK 初始化涂鸦智能SDK

Declared In

TuyaSmartSDK.h

– updateLatitude:longitude:

Report location if needed

- (void)updateLatitude:(double)latitude longitude:(double)longitude

Parameters

latitude

latitude

longitude

longitude

Discussion

Report location if needed

Declared In

TuyaSmartSDK.h

Log Methods

  debugMode

Debug mode 调试模式

@property (nonatomic, assign) BOOL debugMode

Discussion

Debug mode 调试模式

Declared In

TuyaSmartSDK+Log.h

Upgrade Methods

– checkVersionUpgrade

Check if TuyaSmartKit need to be upgrade to TuyaSmartHomeKit 检测是否需要升级数据 从TuyaSDK 升级到TuyaHomeSDK,需要进行数据升级

- (BOOL)checkVersionUpgrade

Return Value

Whether need to upgrade data

Discussion

Check if TuyaSmartKit need to be upgrade to TuyaSmartHomeKit 检测是否需要升级数据 从TuyaSDK 升级到TuyaHomeSDK,需要进行数据升级

Declared In

TuyaSmartSDK.h

– upgradeVersion:failure:

SDK data upgrade SDK数据升级

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

Parameters

success

Success block

failure

Failure block

Discussion

SDK data upgrade SDK数据升级

Declared In

TuyaSmartSDK.h

PushNotification Methods

  )

Push token

@property (nonatomic, strong) NSString *DEPRECATED_MSG_ATTRIBUTE ( "Use +[TuyaSmartSDK sharedInstance].deviceToken instead." )

Discussion

Push token

Declared In

TuyaSmartSDK.h

  deviceToken

Push deviceToken

@property (nonatomic, strong) NSData *deviceToken

Discussion

Push deviceToken

Declared In

TuyaSmartSDK.h

– setDeviceToken:withError:

Set push device token and error info 设置推送token以及错误信息

- (void)setDeviceToken:(nullable NSData *)token withError:(nullable NSError *)error

Parameters

token

deviceToken

error

error info

Discussion

Set push device token and error info 设置推送token以及错误信息

Declared In

TuyaSmartSDK.h

– getPushStatusWithSuccess:failure:

Get notification push status 获取 APP 消息推送的开启状态

- (void)getPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get notification push status 获取 APP 消息推送的开启状态

Declared In

TuyaSmartSDK.h

– setPushStatusWithStatus:success:failure:

Set notification push status 开启或者关闭 APP 消息推送

- (void)setPushStatusWithStatus:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure

Parameters

enable

open or close

success

Success block

failure

Failure block

Discussion

Set notification push status 开启或者关闭 APP 消息推送

Declared In

TuyaSmartSDK.h

– getDevicePushStatusWithSuccess:failure:

Get device alarm push status 获取 APP 设备告警通知的开启状态

- (void)getDevicePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get device alarm push status 获取 APP 设备告警通知的开启状态

Declared In

TuyaSmartSDK.h

– setDevicePushStatusWithStauts:success:failure:

Set device alarm push status 开启或者关闭 APP 设备告警推送消息

- (void)setDevicePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure

Parameters

enable

open or close

success

Success block

failure

Failure block

Discussion

Set device alarm push status 开启或者关闭 APP 设备告警推送消息

Declared In

TuyaSmartSDK.h

– getFamilyPushStatusWithSuccess:failure:

Get family message push status 获取 APP 家庭通知的开启状态

- (void)getFamilyPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get family message push status 获取 APP 家庭通知的开启状态

Declared In

TuyaSmartSDK.h

– setFamilyPushStatusWithStauts:success:failure:

Set family message push status 开启或者关闭 APP 家庭推送消息

- (void)setFamilyPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure

Parameters

enable

open or close

success

Success block

failure

Failure block

Discussion

Set family message push status 开启或者关闭 APP 家庭推送消息

Declared In

TuyaSmartSDK.h

– getNoticePushStatusWithSuccess:failure:

Get notice message push status 获取 APP 消息通知的开启状态

- (void)getNoticePushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get notice message push status 获取 APP 消息通知的开启状态

Declared In

TuyaSmartSDK.h

– setNoticePushStatusWithStauts:success:failure:

Set notice message push status 开启或者关闭 APP 消息通知推送

- (void)setNoticePushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure

Parameters

enable

open or close

success

Success block

failure

Failure block

Discussion

Set notice message push status 开启或者关闭 APP 消息通知推送

Declared In

TuyaSmartSDK.h

– getMarketingPushStatusWithSuccess:failure:

Get market message push status 获取 APP 营销类消息的开启状态

- (void)getMarketingPushStatusWithSuccess:(__nullable TYSuccessBOOL)success failure:(__nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Get market message push status 获取 APP 营销类消息的开启状态

Declared In

TuyaSmartSDK.h

– setMarketingPushStatusWithStauts:success:failure:

Set market message push status 开启或者关闭 APP 营销类消息推送

- (void)setMarketingPushStatusWithStauts:(BOOL)enable success:(__nullable TYSuccessHandler)success failure:(__nullable TYFailureError)failure

Parameters

enable

open or close

success

Success block

failure

Failure block

Discussion

Set market message push status 开启或者关闭 APP 营销类消息推送

Declared In

TuyaSmartSDK.h