Build an App for iOS to Manage Fingerbot?

Step 1: Get the key information of the App SDK

Build an app on the Tuya IoT Platform, get the values of AppKey and AppSecret, and then download the security image of the App SDK.

  1. Log in to the Tuya IoT Platform.

  2. Click App in the left-side navigation bar.

  3. Choose App > App SDK > SDK Development and click Create App.

  4. Enter information about the app.

 App Name: Enter a name for the app.

 App Package for iOS: Enter a name for the app package for iOS, such as com.testapp.smartiot.

 App Package for Android: Enter a name for the app package for Android, such as com.testapp.smartiot.

 Channel ID: Optional. If you do not set the value, the system automatically generates a channel ID according to the package name.

  1. Click OK.

  2. Click the created app to enter the detail page. Click Get Key to check the values of AppKey AppSecret, and App Security Image for Android.

Step 2: Configure and run the sample file

Configure the sample file with the key information, and install a third-party library.

  1. Open Terminal and run sudo gem install cocoapods && pod setup to instal CocoaPods。

  2. Download the Github sample project tuya-ios-fingerbot-demo for iOS.

  3. Open Terminal and run Pod install in a local directory to install the third-party library.

  4. Open tuya-fingerbot-ios-objc.xcworkspace via Xcode.

  5. Enter the name of the app package for iOS in Signing & Capabilities > Bundle Identifier.

  6. Name the iOS security image in the App SDK key information as t_s.bmp and save it in the tuya-ios-fingerbot-objcdirectory.

  7. Choose tuya-ios-fingerbot-objc > Example for tuya-ios-fingerbot-objc > AppKey.h, configure the APP_SECRET_KEYand APP_KEY fields of the App SDK with the values of AppKey and AppSecret.

Step 3: Remotely control the Fingerbot that is connected through a gateway

After you add the Fingerbot to your app by using a gateway, you can remotely control the Fingerbot on the app.

  1. Run the sample in Xcode.

  2. Register and log in to Fingerbot Sample app.

  3. Select your home.

  4. Tap New Home to create a home.

  5. Tap Current Home to select the newly created home.

  6. Select the Bluetooth Low Energy mode to connect the Fingerbot and the gateway to the Fingerbot Sample app.

  7. The following video tutorial shows how to add the Fingerbot to your app.

Operation result

Now, you can remotely control the Fingerbot on the app.

• When the switch mode is disabled, you can tap the switch. Then, the Fingerbot runs in clicking mode and performs a clicking task.

• When the switch mode is enabled, you can tap the switch. Then, the Fingerbot runs in switching mode and goes up or down.

• Up and Down: the range in which the Fingerbot can go up or down.

• Duration: the duration in which the Fingerbot clicks and holds a button in clicking mode.

Device control implementation procedure

  1. Log in to the Tuya IoT Platform, create a Fingerbot product, and then click Export Function on the Function Definition page to get the DP information.

Note: For more information about product creation, see Create Products.

  1. Get the values of TuyaSmartDevice by deviceID. The schemaArray in the TuyaSmartDeviceModel property stores information about DPs and relevant operations.

  2. The control panel receives DP updates and sends the updates to the device.

  3. Implement TuyaSmartHomeDelegate to synchronize DP updates of the device to the control panel. For example, the data is synchronized when the device is manually controlled or DP linkage is triggered.Step 1: Get the key information of the App SDK
    Build an app on the Tuya IoT Platform, get the values of AppKey and AppSecret, and then download the security image of the App SDK.

  4. Log in to the Tuya IoT Platform.

  5. Click App in the left-side navigation bar.

  6. Choose App > App SDK > SDK Development and click Create App.

  7. Enter information about the app.
     App Name: Enter a name for the app.
     App Package for iOS: Enter a name for the app package for iOS, such as com.testapp.smartiot.
     App Package for Android: Enter a name for the app package for Android, such as com.testapp.smartiot.
     Channel ID: Optional. If you do not set the value, the system automatically generates a channel ID according to the package name.

  8. Click OK.

  9. Click the created app to enter the detail page. Click Get Key to check the values of AppKey AppSecret, and App Security Image for Android.

Step 2: Configure and run the sample file
Configure the sample file with the key information, and install a third-party library.

  1. Open Terminal and run sudo gem install cocoapods && pod setup to instal CocoaPods。

  2. Download the Github sample project tuya-ios-fingerbot-demo for iOS.

  3. Open Terminal and run Pod install in a local directory to install the third-party library.

  4. Open tuya-fingerbot-ios-objc.xcworkspace via Xcode.

  5. Enter the name of the app package for iOS in Signing & Capabilities > Bundle Identifier.

  6. Name the iOS security image in the App SDK key information as t_s.bmp and save it in the tuya-ios-fingerbot-objcdirectory.

  7. Choose tuya-ios-fingerbot-objc > Example for tuya-ios-fingerbot-objc > AppKey.h, configure the APP_SECRET_KEYand APP_KEY fields of the App SDK with the values of AppKey and AppSecret.

Step 3: Remotely control the Fingerbot that is connected through a gateway
After you add the Fingerbot to your app by using a gateway, you can remotely control the Fingerbot on the app.

  1. Run the sample in Xcode.

  2. Register and log in to Fingerbot Sample app.

  3. Select your home.

  4. Tap New Home to create a home.

  5. Tap Current Home to select the newly created home.

  6. Select the Bluetooth Low Energy mode to connect the Fingerbot and the gateway to the Fingerbot Sample app.

  7. The following video tutorial shows how to add the Fingerbot to your app.
    Operation result
    Now, you can remotely control the Fingerbot on the app.
    • When the switch mode is disabled, you can tap the switch. Then, the Fingerbot runs in clicking mode and performs a clicking task.
    • When the switch mode is enabled, you can tap the switch. Then, the Fingerbot runs in switching mode and goes up or down.
    • Up and Down: the range in which the Fingerbot can go up or down.
    • Duration: the duration in which the Fingerbot clicks and holds a button in clicking mode.

Device control implementation procedure

  1. Log in to the Tuya IoT Platform, create a Fingerbot product, and then click Export Function on the Function Definition page to get the DP information.
    Note: For more information about product creation, see Create Products.
  2. Get the values of TuyaSmartDevice by deviceID. The schemaArray in the TuyaSmartDeviceModel property stores information about DPs and relevant operations.
  3. The control panel receives DP updates and sends the updates to the device.
  4. Implement TuyaSmartHomeDelegate to synchronize DP updates of the device to the control panel. For example, the data is synchronized when the device is manually controlled or DP linkage is triggered.

So much for the open api they promised…