English
English
简体中文
Contact Us
Register
Log In

Socket Control Panel

Last Updated on : 2021-11-22 08:56:03download

The socket control panel library TuyaSmartSocketPanelKit provides APIs for apps on iOS 9.0 or later. This panel library is developed with native code and supports most Connected by Tuya products and data points (DPs). You can easily integrate the panel library into your project to implement all-around capabilities for products in Tuya’s ecosystem.

Advantages

  • Apply to new products without app launching and provide services for a single category that is not supported by your app.
  • Native code can be used immediately after integration.
  • Facilitate debugging during development.
  • Allow product display after configurations. For more information, see DIY style UI template usage guide.

Socket Control Panel Socket Control Panel Socket Control Panel

How it works

  1. Integrate TuyaSmartSocketPanelKit into your project with CocoaPods.

  2. Add the following line to the Podfile.

    pod 'TuyaSmartSocketPanelKit'
    
  3. Add the following code block to the home page where devices are listed.

    #import "DeviceListViewController.h"
    #import <TuyaSmartSocketPanelKit/TuyaSmartSocketPanelKit.h>
    
    @implementation DeviceListViewController.h
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    	[tableView deselectRowAtIndexPath:indexPath animated:YES];
    	TuyaSmartDevice *device = self.deviceList[indexPath.row];
    
    	// ...
    	TuyaSmartSocketManager *manager = [[TuyaSmartSocketManager alloc] initWithDeviceId:device.deviceModel.devId];
    	[self.navigationController pushViewController:manager.viewController animated:YES];          
    }
    
    @end