TuyaInc / tuyasmart_home_ios_sdk

Tuya Smart iOS Home SDK
https://tuyainc.github.io/tuyasmart_home_ios_sdk_doc
50 stars 19 forks source link

iOS_SDK是否有监听设备上下线的回调? #53

Closed Tony-Day closed 4 years ago

Tony-Day commented 4 years ago

1、iOS_SDK是否有类似安卓监听设备上下线的回调 图片

2、iOS_SDK 如何设置设备离线提醒?就是截图里涂鸦APP里的离线提醒?离线提醒的时机是怎样? 图片

TuyaRonbin commented 4 years ago

问题1: 基于家庭维护的:

@protocol TuyaSmartHomeDelegate <NSObject>

@optional

/**
 *  the delegate of home update information, such as the name, online
 *  家庭信息变化代理回调
 *
 *  @param home instance
 */
- (void)homeDidUpdateInfo:(TuyaSmartHome *)home;

基于设备维度的:

@protocol TuyaSmartDeviceDelegate<NSObject>

@optional

/**
 *  Device info update, such as the name, online
 *  设备基本信息(例如名字,在线状态等)变化代理回调
 *
 *  @param device instance
 */
- (void)deviceInfoUpdate:(TuyaSmartDevice *)device;

问题2: 离线提醒这个功能,SDK 没有实现,后面会排期添加这个功能