FAQ UI BizBundle

Last Updated on : 2024-07-16 06:28:45download

FAQ UI BizBundle provides the iOS container that hosts the FAQ and feedback service to implement troubleshooting and feedback for your apps.

Integrate with the UI BizBundle

Add the components of the FAQ UI BizBundle to the Podfile and run the command pod update.

source "https://github.com/tuya/tuya-pod-specs"
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'your_target_name' do
  # Adds the UI BizBundle.
  pod 'ThingSmartHelpCenterBizBundle'
end

Service protocols

Provide services

Navigate to FAQ and feedback

The UI BizBundle relies on the implementation of ThingHelpCenterProtocol and ThingFeedBackProtocol to provide services. You can view the file ThingHelpCenterProtocol.h in the component ThingModuleServices.

@protocol ThingHelpCenterProtocol <NSObject>

@optional

/**
 * Navigates to the FAQ and feedback page.
 **/
- (void)gotoHelpCenter;

@end

Navigate to the service ticket for unbinding

A device of strong binding cannot be paired again after it is manually reset. The user must first submit a service ticket to request unbinding such a device before pairing it again. ThingFeedBackProtocol provides the navigation to the service ticket for unbinding a strong binding device. You can view the ThingHelpCenterProtocol.h in the component ThingModuleServices.

@protocol ThingFeedBackProtocol <NSObject>

@optional

/**
 * Navigate to feedback page

 *@param hdType         Type of feedback
 *@param hdId           device ID
 *@param uuid           uuid
 *@param region         Area code
 *@param need           Whether to refresh the feedback list page
 *@discussion hdType = 8 indicates an unbundled page
 **/
- (void)gotFeedBackViewControllerWithHdType:(NSInteger)hdType deviceName:(NSString *)deviceName hdId:(NSString *)hdId uuid:(NSString *)uuid region:(NSString *)region withoutRefresh:(BOOL)need;

@end

Depend on services

None.

API list

Things to note

  • Before the call of any API method, make sure that the user has logged in to the app.
  • If the user status is changed, you must check the availability of the FAQ UI BizBundle to reload the FAQ and feedback page.

Navigate to the FAQ and feedback page

ObjC:

#import <ThingSmartBizCore/ThingSmartBizCore.h>
#import <ThingModuleServices/ThingHelpCenterProtocol.h>

id<ThingHelpCenterProtocol> impl = [[ThingSmartBizCore sharedInstance] serviceOfProtocol:@protocol(ThingHelpCenterProtocol)];

[impl gotoHelpCenter];

Swift:

let impl = ThingSmartBizCore.sharedInstance().service(of: ThingHelpCenterProtocol.self) as? ThingHelpCenterProtocol

impl?.gotoHelpCenter()

Navigate to the service ticket for unbinding

ObjC:

#import <ThingSmartBizCore/ThingSmartBizCore.h>
#import <ThingModuleServices/ThingFeedBackProtocol.h>

id<ThingFeedBackProtocol> impl = [[ThingSmartBizCore sharedInstance] serviceOfProtocol:@protocol(ThingFeedBackProtocol)];

[impl gotFeedBackViewControllerWithHdType:8 deviceName:name  hdId:devId uuid:uuid region:@"" withoutRefresh:YES];

Swift:

let impl = ThingSmartBizCore.sharedInstance().service(of:ThingFeedBackProtocol.self) as? ThingFeedBackProtocol

impl?.gotFeedBackViewController?(withHdType: 8, deviceName: "", hdId: "", uuid: "", region: "", withoutRefresh: true)