integrating-tuya-ios-device-control-ui
概述 {#description}
在已接入 Tuya Smart App SDK 的 iOS ObjC 工程中,集成设备控制 UI 业务包,实现一键跳转设备/群组控制面板,无需自行开发面板 UI。
前置条件:已完成 integrating-tuya-ios-sdk 和 integrating-tuya-ios-bizbundle-framework(ThingSmartBizCore 已初始化、updateConfig 已在登录后调用)。
适用场景 {#scene}
已完成 BizBundle 框架层初始化,用户已登录且有至少一个家庭,需要为 App 设备列表中的设备添加面板跳转能力时使用。
步骤:
-
添加 Podfile 依赖:加入
ThingSmartPanelBizBundle(必选)。详见references/device-control-ui.md。 -
配置 Info.plist 权限:面板可能需要相机、麦克风、相册、定位、蓝牙等权限。详见
references/device-control-ui.md。 -
注册
ThingFamilyProtocol服务(必须):实现getCurrentHome返回当前ThingSmartHome实例,必须在打开面板之前注册。若已在integrating-tuya-ios-home-bizbundle中注册过,此步骤无需重复。详见references/device-control-ui.md。 -
调用面板接口:通过
ThingPanelProtocol调用getPanelViewControllerWithDeviceModel:initialProps:contextProps:completionHandler:获取面板控制器并跳转;群组面板使用getPanelViewControllerWithGroupModel:...。详见references/device-control-ui.md。