Skip to content

TuyaSmartLockKit provides APIs for smart door locks.

License

Notifications You must be signed in to change notification settings

tuya/tuya-lock-ios-demo

Repository files navigation

Tuya iOS Smart Life App SDK Sample for Objective-C

This sample demonstrates the use of Tuya iOS Smart Life App SDK to build an IoT app from scratch. Tuya iOS Smart Life App SDK is divided into several function groups to give developers a clear insight into the implementation for different features, including the user registration process, home management for different users, device network configuration, and controls. For device network configuration, the EZ mode and AP mode are implemented. This allows developers to pair devices over Wi-Fi and control the devices over LAN and MQTT. For device control, a common panel is used to send and receive any type of data points.

English | 中文版 Tuya Smart app

Self-developed Smart Life App Service

Self-Developed Smart Life App is one of Tuya’s IoT app development solutions. This solution provides the services that enable connections between the app and the cloud. It also supports a full range of services and capabilities that customers can use to independently develop mobile apps. The Smart Life App SDK used in this sample is included in the Self-developed Smart Life App Service.

Self-Developed Smart Life App is classified into the Trial and Official editions:

  • Self-Developed App Trial: provided for a free trial. It supports up to 100,000 cloud API calls per month and up to 20 registered end users in total.

  • Self-Developed App Official: provided for commercial use and costs $5,000/year (¥33,500/year) for the initial subscription and $2,000/year (¥13,500/year) for subsequent annual renewal. It is supplied with the Custom Domain Name service and up to 100 million cloud API calls per month.

For more information, please check the Pricing.

Prerequisites

  • Xcode 12.0 and later
  • iOS 12 and later

Use the sample

  1. The Tuya iOS Smart Life App SDK is distributed through CocoaPods and other dependencies in this sample. Make sure that you have installed CocoaPods. If not, run the following command to install CocoaPods first:
sudo gem install cocoapods
pod setup
  1. Clone or download this sample, change the directory to the one that includes Podfile, and then run the following command:
pod install
  1. This sample requires you to have a pair of keys and a security image from Tuya IoT Platform, and register a developer account if you don't have one. Then, perform the following steps:

    1. Log in to the Tuya IoT platform. In the left-side navigation pane, choose App > SDK Development.
    2. Click Create to create an app.
    3. Fill in the required information. Make sure that you enter the valid Bundle ID. It cannot be changed afterward.
    4. You can find the AppKey, AppSecret, and security image under the Obtain Key tag.
  2. Open the TuyaAppSDKSample-iOS-ObjC.xcworkspace pod generated for you.

  3. Fill in the AppKey and AppSecret in the AppKey.h file.

#define APP_KEY @"<#AppKey#>"
#define APP_SECRET_KEY @"<#SecretKey#>"
  1. Download the security image, rename it to t_s.bmp, and then drag it to the workspace to be at the same level as Info.plist.

Note: The bundle ID, AppKey, AppSecret, and security image must be the same as your app on the Tuya IoT Platform. Otherwise, the sample cannot request the API.

References

For more information about Tuya iOS HomeSDK, see App SDK.

About

TuyaSmartLockKit provides APIs for smart door locks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages