常见问题与反馈 UI 业务包

更新时间:2023-10-12 02:38:59下载pdf

常见问题与反馈 UI 业务包提供承载 用户问题与反馈 的 iOS 容器,为您的 App 提供问题排查与反馈渠道。

接入组件

在工程的 Podfile 文件中添加常见问题与反馈业务包组件,并执行 pod update 命令:

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

target 'your_target_name' do
  # 添加常见问题与反馈业务包
  pod 'ThingSmartHelpCenterBizBundle'
end

服务协议

提供服务

跳转到常见问题与反馈页面

常见问题与反馈业务包实现 ThingHelpCenterProtocolThingFeedBackProtocol 协议以提供服务。在 ThingModuleServices 组件中查看 ThingHelpCenterProtocol.h 协议文件内容为:

@protocol ThingHelpCenterProtocol <NSObject>

@optional

/**
 * 跳转到常见问题与反馈页面
 **/
- (void)gotoHelpCenter;

@end

跳转解绑工单

针对已配网成功的强绑定类型设备,通过手动重置设备去配网会报失败。需要先通过工单申请解绑成功,才能重新配网成功。ThingFeedBackProtocol 提供强绑定设备解绑工单入口,在 ThingModuleServices 组件中查看 ThingHelpCenterProtocol.h 协议文件内容为:

@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

依赖服务

无。

使用指南

注意事项

  • 调用任何接口之前,务必确认用户已登录。
  • 登录用户发生状态变化时,务必重新判断常见问题与反馈业务包可用状态,并重新获取常见问题与反馈页面。

跳转反馈页面

Objective-C 示例

#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()

跳转解绑工单

Objective-C 示例

#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)