更新时间:2025-04-11 02:05:56下载pdf
解决网关按键误触重置问题。
业务包版本要在 v6.2.0 及以上。
source 'https://github.com/tuya/tuya-pod-specs.git'
platform :ios, '11.0'
target 'Your_Project_Name' do
pod "ThingSmartBusinessExtensionKit"
end
按键防误触管理类
open class ThingAntiMisoperationManager : NSObject {
...
}
按键防误触监听器
public protocol ThingAntiMisoperationManagerListener : NSObjectProtocol {
optional func antiMisoperationManager(_ manager: ThingAntiMisoperationManager, statusDidUpdate status: Bool)
}
添加监听器
open func add(_ listener: any ThingAntiMisoperationManagerListener)
入参 | 类型 | 说明 |
---|---|---|
listener | ThingAntiMisoperationManagerListener | 监听器对象 |
移除监听器
open func remove(_ listener: any ThingAntiMisoperationManagerListener)
入参 | 类型 | 说明 |
---|---|---|
listener | ThingAntiMisoperationManagerListener | 监听器对象 |
判断设备是否支持按键防误触
open func isSupport(success: ((Bool) -> Void)?, failure: ((any Error) -> Void)? = nil)
入参 | 类型 | 说明 |
---|---|---|
success | Bool | 成功回调。true 表示支持,false 表示不支持 |
failure | error | 错误信息 |
获取按键防误触状态
open func getStatus()
需要通过监听器获取状态回调。
更新按键防误触状态
open func updateStatus(_ status: Bool)
入参 | 类型 | 说明 |
---|---|---|
status | Bool | 按键防误触状态 |
需要通过监听器获取状态回调。
更多信息,参考 Demo。
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈