English
English
简体中文
Contact Us
Register
Log In
layoutIndex

Generic Pairing BizBundle

Last Updated on : 2022-03-01 08:33:07download

Generic Pairing BizBundle for iOS is used to query a list of pairing data. It provides the capabilities to customize the pattern to display the returned list. You can customize the list page based on the pairing lists supported by the Tuya IoT Development Platform.

Functional description

You must call API methods in TuyaSmartActivatorService to get information about the list views.

Integrate with the UI BizBundle

Add the components of the Voice Skills Account Linking UI BizBundle to the Podfile and run the command pod update.

source "https://github.com/TuyaInc/TuyaPublicSpecs.git"
source 'https://cdn.cocoapods.org/'

target 'your_target_name' do
  pod 'TuyaSmartActivatorExtraBizBundle'
end

Depend on services

None.

Query level-1 category for pairing

API description

- (void)requestLevelOneListWithSuccess:(void(^)(TuyaSmartACategoryModel * _Nullable model))success
                               failure:(void(^)(NSError *error))failure;

Parameters

None.

ObjC:

self.service = [TuyaSmartActivatorService new];
[self.service requestLevelOneListWithSuccess:^(TuyaSmartACategoryModel * _Nullable model) {

} failure:^(NSError * _Nonnull error) {

}];

Swift:

service = TuyaSmartActivatorService()
service.requestLevelOneList(withSuccess: { (result) in

}, failure: { (error) in

})

Query level-2 category for pairing

API description

- (void)requestLevelSecondListWithLevelOneCode:(NSString *)levelOneCode
                                          type:(NSString *)type
                                       success:(void(^)(NSArray<TuyaSmartACategoryLevel2Model *> * _Nullable modelList))success
                                       failure:(void(^)(NSError *error))failure;

Parameters

Name Type Description
levelOneCode NSString The value of levelOneCode for the level-1 category.
type NSString The type of the level-1 category.

ObjC:

self.service = [TuyaSmartActivatorService new];
[self.service requestLevelSecondListWithLevelOneCode:levelOneCode type:type success:^(NSArray<TuyaSmartACategoryLevel2Model *> * _Nullable modelList) {

} failure:^(NSError * _Nonnull error) {

}];

Swift:

service = TuyaSmartActivatorService()
service.requestLevelSecondList(withLevelOneCode: levelOneCode, type: type, success: { (result) in

}, failure: { (error) in

})

Query level-3 category for pairing

API description

- (void)requestCategoryDetailWithPID:(NSString * _Nullable)PID
                            category:(NSString * _Nullable)category
                             success:(void(^)(TuyaSmartDeviceCategoryModel * _Nullable model))success
                             failure:(void(^)(NSError *error))failure;

Parameters

Name Type Description
PID NSString The product ID.
category NSString The product category.

ObjC:

self.service = [TuyaSmartActivatorService new];
[service requestCategoryDetailWithPID:pid category:category success:^(TuyaSmartDeviceCategoryModel * _Nullable model) {

} failure:^(NSError * _Nonnull error) {

}];

Swift:

service = TuyaSmartActivatorService()
service.requestCategoryDetail(withPID: pid, category: category, success: { (result) in

}, failure: { (error) in

})