1. Integrated SDK
1.1. Integrated SDK
The IPC SDK depends on the user management, device configuration, home management, device management parts of the Home SDK, and on this basis, the functions of the smart camera device are realized.
Modules
Module | Description |
---|---|
TuyaSmartActivatorKit | Device network configuration |
TuyaSmartCameraKit | Tuya smart camera business core kit |
TuyaSmartCameraKit
is not a separate library, refer to SDK Architecture.
Add the following content in the Podfile
file.
platform :ios, '9.0'
target 'your_target_name' do
pod "TuyaSmartActivatorKit"
pod "TuyaSmartCameraKit"
# pod "TuyaSmartCameraT"
end
If your App need to support p2p 1.0, need to add pod "TuyaSmartCameraT"
.
Then run the pod update
command in the root directory of project. For use of CocoaPods, please refer to the CocoaPods Guides. It is recommended to update the CocoaPods to the latest version.
1.2. Initialize SDK
Open project setting,
Target => General
, editBundle Identifier
to the value from Tuya develop center.Import security image to the project and rename as
t_s.bmp
, then add it intoProject Setting => Target => Build Phases => Copy Bundle Resources
, refer to Preparation for Integration.Add the following to the project file
PrefixHeader.pch
, Swift project add the following to thexxx_Bridging-Header.h
file:#import <TuyaSmartBaseKit/TuyaSmartBaseKit.h> #import <TuyaSmartActivatorKit/TuyaSmartActivatorKit.h> #import <TuyaSmartCameraKit/TuyaSmartCameraKit.h>
Open file
AppDelegate.m
,and use theApp Key
andApp Secret
obtained from the development platform in the[AppDelegate application:didFinishLaunchingWithOptions:]
method to initialize SDK:ObjC
[[TuyaSmartSDK sharedInstance] startWithAppKey:<#your_app_key#> secretKey:<#your_secret_key#>];
Swift
TuyaSmartSDK.sharedInstance()?.start(withAppKey: <#your_app_key#>, secretKey: <#your_secret_key#>)
Now all the prepare work has been completed. You can use the sdk to develop your application now.
1.3. Debug Mode
During the development we can open debug mode, print the log to analyze some problem.
ObjC
#ifdef DEBUG
[[TuyaSmartSDK sharedInstance] setDebugMode:YES];
#else
#endif
Swift
#if DEBUG
TuyaSmartSDK.sharedInstance()?.debugMode = true
#else
#endif
1.4. Demo App
Refer to Home SDK Demo App introduction, configure BundleId
, AppKey
, AppSecret
, and security picture correctly.
IPC SDK Demo App adds a control panel module for IPC device based on the functions of Home SDK Demo App.
- Live video panel: The p2p connection process of IPC device, live video, memory card recording, screenshots, intercom and other functions.
- Playback panel: The acquisition and playback of video clips in the device memory card, the use of timeline components.
- Cloud storage panel: Cloud storage service activation, status judgment, cloud storage video and cloud storage event acquisition and playback.
- Message panel: Acquisition and display of detect message.
- Setting panel: Use of IPC device standard dp points.