Generic Pairing BizBundle

Last Updated on : 2023-07-13 07:14:39download

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 ThingSmartActivatorService 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/tuya/tuya-private-specs.git'
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'your_target_name' do
  pod 'ThingSmartActivatorExtraBizBundle'
end

Depend on services

None.

Query level-1 category for pairing

API description

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

Parameters

None.

ObjC:

#import <ThingSmartActivatorRequest/ThingSmartActivatorRequest.h>

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

} failure:^(NSError * _Nonnull error) {

}];

Swift:

service = ThingSmartActivatorService()
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<ThingSmartACategoryLevel2Model *> * _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:

#import <ThingSmartActivatorRequest/ThingSmartActivatorRequest.h>

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

} failure:^(NSError * _Nonnull error) {

}];

Swift:

service = ThingSmartActivatorService()
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(^)(ThingSmartDeviceCategoryModel * _Nullable model))success
                             failure:(void(^)(NSError *error))failure;

Parameters

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

ObjC:

#import <ThingSmartActivatorRequest/ThingSmartActivatorRequest.h>

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

} failure:^(NSError * _Nonnull error) {

}];

Swift:

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

}, failure: { (error) in

})