QMChatSDK-Swift.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. // Generated by Apple Swift version 4.1 effective-3.3 (swiftlang-902.0.48 clang-902.0.37.1)
  2. #pragma clang diagnostic push
  3. #pragma clang diagnostic ignored "-Wgcc-compat"
  4. #if !defined(__has_include)
  5. # define __has_include(x) 0
  6. #endif
  7. #if !defined(__has_attribute)
  8. # define __has_attribute(x) 0
  9. #endif
  10. #if !defined(__has_feature)
  11. # define __has_feature(x) 0
  12. #endif
  13. #if !defined(__has_warning)
  14. # define __has_warning(x) 0
  15. #endif
  16. #if __has_include(<swift/objc-prologue.h>)
  17. # include <swift/objc-prologue.h>
  18. #endif
  19. #pragma clang diagnostic ignored "-Wauto-import"
  20. #include <objc/NSObject.h>
  21. #include <stdint.h>
  22. #include <stddef.h>
  23. #include <stdbool.h>
  24. #if !defined(SWIFT_TYPEDEFS)
  25. # define SWIFT_TYPEDEFS 1
  26. # if __has_include(<uchar.h>)
  27. # include <uchar.h>
  28. # elif !defined(__cplusplus)
  29. typedef uint_least16_t char16_t;
  30. typedef uint_least32_t char32_t;
  31. # endif
  32. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  33. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  34. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  35. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  36. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  37. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  38. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  39. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  40. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  41. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  42. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  43. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  44. #endif
  45. #if !defined(SWIFT_PASTE)
  46. # define SWIFT_PASTE_HELPER(x, y) x##y
  47. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  48. #endif
  49. #if !defined(SWIFT_METATYPE)
  50. # define SWIFT_METATYPE(X) Class
  51. #endif
  52. #if !defined(SWIFT_CLASS_PROPERTY)
  53. # if __has_feature(objc_class_property)
  54. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  55. # else
  56. # define SWIFT_CLASS_PROPERTY(...)
  57. # endif
  58. #endif
  59. #if __has_attribute(objc_runtime_name)
  60. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  61. #else
  62. # define SWIFT_RUNTIME_NAME(X)
  63. #endif
  64. #if __has_attribute(swift_name)
  65. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  66. #else
  67. # define SWIFT_COMPILE_NAME(X)
  68. #endif
  69. #if __has_attribute(objc_method_family)
  70. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  71. #else
  72. # define SWIFT_METHOD_FAMILY(X)
  73. #endif
  74. #if __has_attribute(noescape)
  75. # define SWIFT_NOESCAPE __attribute__((noescape))
  76. #else
  77. # define SWIFT_NOESCAPE
  78. #endif
  79. #if __has_attribute(warn_unused_result)
  80. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  81. #else
  82. # define SWIFT_WARN_UNUSED_RESULT
  83. #endif
  84. #if __has_attribute(noreturn)
  85. # define SWIFT_NORETURN __attribute__((noreturn))
  86. #else
  87. # define SWIFT_NORETURN
  88. #endif
  89. #if !defined(SWIFT_CLASS_EXTRA)
  90. # define SWIFT_CLASS_EXTRA
  91. #endif
  92. #if !defined(SWIFT_PROTOCOL_EXTRA)
  93. # define SWIFT_PROTOCOL_EXTRA
  94. #endif
  95. #if !defined(SWIFT_ENUM_EXTRA)
  96. # define SWIFT_ENUM_EXTRA
  97. #endif
  98. #if !defined(SWIFT_CLASS)
  99. # if __has_attribute(objc_subclassing_restricted)
  100. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  101. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  102. # else
  103. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  104. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  105. # endif
  106. #endif
  107. #if !defined(SWIFT_PROTOCOL)
  108. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  109. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  110. #endif
  111. #if !defined(SWIFT_EXTENSION)
  112. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  113. #endif
  114. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  115. # if __has_attribute(objc_designated_initializer)
  116. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  117. # else
  118. # define OBJC_DESIGNATED_INITIALIZER
  119. # endif
  120. #endif
  121. #if !defined(SWIFT_ENUM_ATTR)
  122. # if defined(__has_attribute) && __has_attribute(enum_extensibility)
  123. # define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open)))
  124. # else
  125. # define SWIFT_ENUM_ATTR
  126. # endif
  127. #endif
  128. #if !defined(SWIFT_ENUM)
  129. # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type
  130. # if __has_feature(generalized_swift_name)
  131. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type
  132. # else
  133. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
  134. # endif
  135. #endif
  136. #if !defined(SWIFT_UNAVAILABLE)
  137. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  138. #endif
  139. #if !defined(SWIFT_UNAVAILABLE_MSG)
  140. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  141. #endif
  142. #if !defined(SWIFT_AVAILABILITY)
  143. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  144. #endif
  145. #if !defined(SWIFT_DEPRECATED)
  146. # define SWIFT_DEPRECATED __attribute__((deprecated))
  147. #endif
  148. #if !defined(SWIFT_DEPRECATED_MSG)
  149. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  150. #endif
  151. #if __has_feature(attribute_diagnose_if_objc)
  152. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  153. #else
  154. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  155. #endif
  156. #if __has_feature(modules)
  157. @import ObjectiveC;
  158. @import UIKit;
  159. #endif
  160. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  161. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  162. #if __has_warning("-Wpragma-clang-attribute")
  163. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  164. #endif
  165. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  166. #pragma clang diagnostic ignored "-Wnullability"
  167. #if __has_attribute(external_source_symbol)
  168. # pragma push_macro("any")
  169. # undef any
  170. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="QMChatSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  171. # pragma pop_macro("any")
  172. #endif
  173. /// 消息属性
  174. SWIFT_CLASS("_TtC9QMChatSDK13CustomMessage")
  175. @interface CustomMessage : NSObject
  176. /// id
  177. @property (nonatomic, copy) NSString * _Null_unspecified _id;
  178. /// 设备类型
  179. @property (nonatomic, copy) NSString * _Null_unspecified device;
  180. /// 信息内容
  181. @property (nonatomic, copy) NSString * _Null_unspecified message;
  182. /// 信息类型
  183. @property (nonatomic, copy) NSString * _Nullable messageType;
  184. /// 平台类型
  185. @property (nonatomic, copy) NSString * _Null_unspecified platform;
  186. /// 记录消息的Id
  187. @property (nonatomic, copy) NSString * _Null_unspecified sessionId;
  188. /// 时间
  189. @property (nonatomic, copy) NSString * _Null_unspecified createdTime;
  190. /// 消息来源:0是发送、1是接收
  191. @property (nonatomic, copy) NSString * _Null_unspecified fromType;
  192. /// 消息发送状态 //@“0”发送成功 @“1”发送失败 2正在发送
  193. @property (nonatomic, copy) NSString * _Null_unspecified status;
  194. /// 录音时间
  195. @property (nonatomic, copy) NSString * _Null_unspecified recordSeconds;
  196. /// 新增字段 本地文件路径
  197. @property (nonatomic, copy) NSString * _Null_unspecified localFilePath;
  198. /// 新增字段 网络文件路径
  199. @property (nonatomic, copy) NSString * _Null_unspecified remoteFilePath;
  200. /// 新增字段 文件名
  201. @property (nonatomic, copy) NSString * _Null_unspecified fileName;
  202. /// 新增字段 文件大小
  203. @property (nonatomic, copy) NSString * _Null_unspecified fileSize;
  204. /// 新增字段 下载状态 “0”已下载 “1”未下载 “2”下载中
  205. @property (nonatomic, copy) NSString * _Nullable downloadState;
  206. /// 新增字段iframe类型的消息宽度
  207. @property (nonatomic, copy) NSString * _Null_unspecified width;
  208. /// 新增字段iframe类型的消息高度
  209. @property (nonatomic, copy) NSString * _Null_unspecified height;
  210. /// 新增字段 坐席工号
  211. @property (nonatomic, copy) NSString * _Null_unspecified agentExten;
  212. /// 新增字段 坐席名称
  213. @property (nonatomic, copy) NSString * _Null_unspecified agentName;
  214. /// 新增字段 坐席头像
  215. @property (nonatomic, copy) NSString * _Null_unspecified agentIcon;
  216. /// 新增字段 语音文字
  217. @property (nonatomic, copy) NSString * _Null_unspecified audioText;
  218. /// 新增字段 机器人消息
  219. @property (nonatomic, copy) NSString * _Null_unspecified isRobot;
  220. /// 新增字段 语音未读
  221. @property (nonatomic, copy) NSString * _Null_unspecified isRead;
  222. /// 新增字段 帮助状态 none useless useful
  223. @property (nonatomic, copy) NSString * _Null_unspecified isUseful;
  224. /// 问题ID
  225. @property (nonatomic, copy) NSString * _Null_unspecified questionId;
  226. @property (nonatomic, copy) NSString * _Null_unspecified richTextUrl;
  227. @property (nonatomic, copy) NSString * _Null_unspecified richTextPicUrl;
  228. @property (nonatomic, copy) NSString * _Null_unspecified richTextTitle;
  229. @property (nonatomic, copy) NSString * _Null_unspecified richTextDescription;
  230. - (void)setValue:(id _Nullable)value forUndefinedKey:(NSString * _Nonnull)key;
  231. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  232. @end
  233. SWIFT_CLASS("_TtC9QMChatSDK7QMAgent")
  234. @interface QMAgent : NSObject
  235. /// 坐席工号
  236. @property (nonatomic, copy) NSString * _Null_unspecified exten;
  237. /// 坐席名称
  238. @property (nonatomic, copy) NSString * _Null_unspecified name;
  239. /// 坐席头像
  240. @property (nonatomic, copy) NSString * _Null_unspecified icon_url;
  241. /// 类型
  242. @property (nonatomic, copy) NSString * _Null_unspecified type;
  243. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  244. @end
  245. @protocol QMKRegisterDelegate;
  246. @protocol QMKServiceDelegate;
  247. @class NSDictionary;
  248. @class UIImage;
  249. @class NSArray;
  250. SWIFT_CLASS("_TtC9QMChatSDK9QMConnect")
  251. @interface QMConnect : NSObject
  252. /// 注册accessId、初始化SDK:
  253. /// 初始化成功,建立tcp连接,保证移动端消息的接收,如果建立tcp连接失败,会导致消息接收不到
  254. /// 以通知的方式进行回调
  255. /// param accessId: 接入客服系统的密钥, 可在客服系统登录平台获取
  256. /// param userName: 用户名, 区分用户, 用户名可直接在后台显示
  257. /// param userId: 用户ID, 区分用户
  258. + (void)registerSDKWithAppKey:(NSString * _Nonnull)accessId userName:(NSString * _Nonnull)userName userId:(NSString * _Nonnull)userId;
  259. /// 注册accessId、初始化SDK:
  260. /// 初始化成功,建立tcp连接,保证移动端消息的接收,如果建立tcp连接失败,会导致消息接收不到
  261. /// 以代理的方式进行回调
  262. /// param accessId: 接入客服系统的密钥, 可在客服系统登录平台获取
  263. /// param userName: 用户名, 区分用户, 用户名可直接在后台显示
  264. /// param userId: 用户ID, 区分用户
  265. + (void)registerSDKWithAppKey:(NSString * _Nonnull)accessId userName:(NSString * _Nonnull)userName userId:(NSString * _Nonnull)userId delegate:(id <QMKRegisterDelegate> _Nonnull)delegate;
  266. /// 注销、断开tcp连接
  267. /// 客服人员可收到用户离开的通知
  268. /// 断开后消息可以通过后台接口走离线推送
  269. + (void)logout;
  270. /// 发起新会话:
  271. /// 调用此接口、可以拥有与客服对话的能力、状态以通知的方式回调
  272. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  273. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  274. /// param failBlock: 接入会话失败回调,
  275. + (void)sdkBeginNewChatSession:(NSString * _Nonnull)peer successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  276. /// 发起新会话:
  277. /// 调用此接口、可以拥有与客服对话的能力、携带参数
  278. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  279. /// param params: 自定义参数
  280. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  281. /// param failBlock: 接入会话失败回调,
  282. + (void)sdkBeginNewChatSession:(NSString * _Nonnull)peer params:(NSDictionary<NSString *, id> * _Nonnull)params successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  283. /// 发起新会话:
  284. /// 启用日程管理的用此接口
  285. /// 调用此接口、可以拥有与客服对话的能力、携带参数
  286. /// param schedule: 日程管理所需参数,传入此参数会话才能接入对应日程管理状态
  287. /// param params: 自定义参数
  288. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  289. /// param failBlock: 接入会话失败回调,
  290. + (void)sdkBeginNewChatSessionSchedule:(NSString * _Nonnull)scheduleId processId:(NSString * _Nonnull)processId currentNodeId:(NSString * _Nonnull)currentNodeId params:(NSDictionary<NSString *, id> * _Nonnull)params successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  291. /// 发起新会话:
  292. /// 调用此接口、可以拥有与客服对话的能力、状态以代理方法的方式回调
  293. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  294. /// param delegate: 聊天界面的代理方法,
  295. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  296. /// param failBlock: 接入会话失败回调,
  297. + (void)sdkBeginNewChatSessionWithDelegate:(NSString * _Nonnull)peer delegate:(id <QMKServiceDelegate> _Nonnull)delegate successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  298. /// 其他坐席服务授权
  299. /// 专属坐席未在线的情况下,是否接受其他坐席的服务
  300. /// param peer: 技能组ID, 详见beginSession接口
  301. /// param successBlock: 成功回调
  302. /// param failBlock: 失败回调
  303. + (void)sdkAcceptOtherAgentWithPeer:(NSString * _Nonnull)peer successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  304. /// 会话定时断开
  305. /// 调用此接口、可以再客户在一定时间没有新消息的时候断开会话
  306. /// param successBlock: 成功回调
  307. /// param failBlock: 回调失败
  308. + (void)sdkChatTimerBreaking:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  309. /// 获取渠道全局配置
  310. /// 调用此接口获取后台的全局配置信息,注册成功会主动请求一次插入本地plist文件,用户也可以自行调用获取
  311. /// param configs: 配置信息
  312. /// param successBlock: 成功回调
  313. /// param failBlock: 回调失败
  314. + (void)sdkGetWebchatGlobleConfig:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  315. /// 获取渠道全局配置中的 scheduleConfig
  316. /// 调用此接口获取全局配置中的 scheduleConfig 此接口主要用于开启日程管理需要
  317. /// param configs: 配置信息
  318. /// param successBlock: 成功回调
  319. /// param failBlock: 回调失败
  320. + (void)sdkGetWebchatScheduleConfig:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  321. /// 发送文本消息:
  322. /// 调用此接口、可以发送文本消息,包括文字、表情
  323. /// param text: 文本消息内容
  324. /// param successBlock: 成功回调
  325. /// param failBlock: 失败回调
  326. + (void)sendMsgText:(NSString * _Nonnull)text successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  327. /// 发送图片消息:
  328. /// 调用此接口、可以发送图片消息
  329. /// param pic: 图片消息内容
  330. /// param successBlock: 成功回调
  331. /// param failBlock: 失败回调
  332. + (void)sendMsgPic:(UIImage * _Nonnull)pic successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  333. /// 发送图片消息:
  334. /// 调用此接口、可以发送图片消息
  335. /// param filePath: 图片文件相对路径
  336. /// param successBlock: 成功回调
  337. /// param failBlock: 失败回调
  338. + (void)sendMsgImage:(NSString * _Nonnull)filePath successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  339. /// 发送语音消息:
  340. /// 调用此接口、可以发送语音消息
  341. /// param audio: 语音消息路径 语音名字需要带mp3后缀
  342. /// param duration: 语音消息时长
  343. /// param successBlock: 成功回调
  344. /// param failBlock: 失败回调
  345. + (void)sendMsgAudio:(NSString * _Nonnull)audio duration:(NSString * _Nonnull)duration successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(NSString * _Nonnull))failBlock;
  346. /// 发送文件消息:
  347. /// 调用此接口、可以发送文件消息
  348. /// param fileName: 文件名称
  349. /// param filePath: 沙盒文件相对路径
  350. /// param fileSize: 文件大小
  351. /// param progressHander: 上传进度回调
  352. /// param successBlock: 成功回调
  353. /// param failBlock: 失败回调
  354. + (void)sendMsgFile:(NSString * _Nonnull)fileName filePath:(NSString * _Nonnull)filePath fileSize:(NSString * _Nonnull)fileSize progressHander:(void (^ _Nonnull)(float))progressHander successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  355. /// 下载消息中的文件:
  356. /// param message: 消息实例
  357. /// param localFilePath: 沙盒文件相对路径
  358. /// param progressHander: 下载进度回调
  359. /// param successBlock: 成功回调
  360. /// param failBlock: 失败回调
  361. + (void)downloadFileWithMessage:(CustomMessage * _Nonnull)message localFilePath:(NSString * _Nullable)localFilePath progressHander:(void (^ _Nonnull)(float))progressHander successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(NSString * _Nonnull))failBlock;
  362. /// 消息重发:
  363. /// 调用此接口、将未发送的消息重新发送
  364. /// param message: 消息内容
  365. /// param successBlock: 成功回调
  366. /// param failBlock: 失败回调
  367. + (void)resendMessage:(CustomMessage * _Nonnull)message successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  368. /// 封装消息模型:
  369. /// 目前只支持新增的评价类型消息(不支持文本、语音、图片等)
  370. + (CustomMessage * _Nonnull)createMessageOfInvestigations SWIFT_WARN_UNUSED_RESULT;
  371. /// 获取数据库信息:
  372. /// 调用此接口、获取数据库信息
  373. /// param num : 单次获取消息数目(无默认值)
  374. /// param [CustomMessage]: 返回消息数组
  375. + (NSArray<CustomMessage *> * _Nonnull)getDataFromDatabase:(NSInteger)number SWIFT_WARN_UNUSED_RESULT;
  376. /// 获取单条数据库信息:
  377. /// 调用此接口、获取数据库一条记录、用于消息重发
  378. /// param messageId: 消息ID
  379. /// param [CustomMessage]: 返回消息数组
  380. + (NSArray<CustomMessage *> * _Nonnull)getOneDataFromDatabase:(NSString * _Nonnull)messageId SWIFT_WARN_UNUSED_RESULT;
  381. /// 删除单条数据库信息:
  382. /// 用此接口、删除数据路一条记录、只能删除本地消息
  383. /// param messageId: 消息ID
  384. + (void)removeDataFromDataBase:(NSString * _Nonnull)messageId;
  385. /// 修改语音状态接口:
  386. /// 将语音由未读取状态变为已读取状态
  387. /// param messageId: 消息ID
  388. + (void)changeAudioMessageStatus:(NSString * _Nonnull)messageId;
  389. /// 撤回消息接口:
  390. /// 将发送的消息撤回
  391. /// param messageId: 消息ID
  392. + (void)changeDrawMessageStatus:(NSString * _Nonnull)messageId;
  393. /// 请求人工服务:
  394. /// 调用此接口、请求人工服务(如后台开启智能机器人功能、默认为机器人服务器)
  395. /// param successBlock: 成功回调
  396. /// param failBlock: 失败回调
  397. + (void)sdkConvertManual:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  398. /// 获取满意度评价信息:
  399. /// 用于满意度调查
  400. /// param investigateArray: 评价信息
  401. /// param successBlock: 成功回调
  402. /// param failureBlock : 失败回调
  403. + (void)sdkGetInvestigate:(void (^ _Nonnull)(NSArray * _Nonnull))successBlock failureBlock:(void (^ _Nonnull)(void))failureBlock;
  404. /// 获取技能组信息:
  405. /// 开始会话前选择技能组进入
  406. /// param investigateArray: 评价信息
  407. /// param successBlock: 成功回调
  408. /// param failureBlock: 失败回调
  409. + (void)sdkGetPeers:(void (^ _Nonnull)(NSArray * _Nonnull))successBlock failureBlock:(void (^ _Nonnull)(void))failureBlock;
  410. /// 提交满意度调查信息
  411. /// param name: 评价信息
  412. /// param value: 评价信息ID
  413. /// param successBlock: 成功回调
  414. /// param failBlock: 失败回调
  415. + (void)sdkSubmitInvestigate:(NSString * _Nonnull)name value:(NSString * _Nonnull)value successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  416. /// 留言接口
  417. /// 客服离线状态下,未配置机器人客服或转人工客服时,可进行留言操作
  418. /// param phone: 联系电话
  419. /// param Email: 联系邮箱
  420. /// param message: 留言内容
  421. /// param successBlock: 成功回调
  422. /// param failBlock: 失败回调
  423. + (void)sdkSubmitLeaveMessage:(NSString * _Nonnull)peer phone:(NSString * _Nonnull)phone Email:(NSString * _Nonnull)Email message:(NSString * _Nonnull)message successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  424. /// 留言接口
  425. /// 客服离线状态下,未配置机器人客服或转人工客服时,可进行留言操作
  426. + (void)sdkSubmitLeaveMessageWithInformation:(NSString * _Nonnull)peer information:(NSDictionary<NSString *, NSString *> * _Nonnull)information leavemsgFields:(NSArray<NSDictionary<NSString *, id> *> * _Nonnull)leavemsgFields message:(NSString * _Nonnull)message successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  427. /// 机器人反馈
  428. + (void)sdkSubmitRobotFeedback:(BOOL)isUseful questionId:(NSString * _Nonnull)questionId messageId:(NSString * _Nonnull)messageId successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  429. /// 自建服务器设置网络地址:
  430. /// 是不是自建服务器的用户不需要设置此项
  431. /// param tcpHost: TCP连接地址
  432. /// param tcpPort: TCP端口号
  433. /// param httpPost: HTTP请求地址
  434. + (void)setServerAddress:(NSString * _Nonnull)tcpHost tcpPort:(NSInteger)tcpPort httpPost:(NSString * _Nonnull)httpPost;
  435. /// 是否启用留言功能
  436. /// 全局配置:
  437. /// 启用留言功能,坐席不在线跳转到留言面板进行留言
  438. /// 未启用留言功能,坐席不在线,不会跳转至留言面板
  439. + (BOOL)allowedLeaveMessage SWIFT_WARN_UNUSED_RESULT;
  440. /// 留言提示窗口信息
  441. /// 全局配置:
  442. /// 未启用留言状态下,弹出的提示内容
  443. + (NSString * _Nonnull)leaveMessageAlert SWIFT_WARN_UNUSED_RESULT;
  444. /// 留言内容占位
  445. /// 全局配置:
  446. /// 启用留言状态下,展示在留言板输入框的占位提醒
  447. + (NSString * _Nonnull)leaveMessagePlaceholder SWIFT_WARN_UNUSED_RESULT;
  448. /// 留言自定义配置
  449. /// 全局配置:
  450. /// 后台留言板联系方式自定义字段
  451. + (NSArray * _Nonnull)leaveMessageContactInformation SWIFT_WARN_UNUSED_RESULT;
  452. /// 是否启用用户无响应会话自动关闭功能
  453. /// 全局配置:
  454. /// 用户长时间未给坐席发送消息,自动关闭当前会话 并退出聊天界面,需要后台正确配置 提示和断开时间
  455. + (BOOL)allowedBreakSession SWIFT_WARN_UNUSED_RESULT;
  456. /// 自动关闭会话提示语
  457. /// 全局配置:
  458. /// 后台配置的提示语,在断开前进行提示
  459. + (NSString * _Nonnull)breakSessionAlert SWIFT_WARN_UNUSED_RESULT;
  460. /// 自动关闭会话时间
  461. /// 全局配置:
  462. /// 从开始新的会话、或用户发送一条消息开始计时
  463. + (NSInteger)breakSessionDuration SWIFT_WARN_UNUSED_RESULT;
  464. /// 自动关闭会话提示时间
  465. /// 全局配置:
  466. /// 关闭会话前进行的提示的时间,从开始新的会话、或用户发送一条消息开始计时
  467. + (NSInteger)breakSessionAlertDuration SWIFT_WARN_UNUSED_RESULT;
  468. /// 判断是否启用机器人
  469. + (BOOL)allowRobot SWIFT_WARN_UNUSED_RESULT;
  470. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  471. @end
  472. typedef SWIFT_ENUM(NSInteger, QMKErrorDomain) {
  473. /// key不存在
  474. QMKErrorDomainKeyNotFound = -4999,
  475. /// key不匹配
  476. QMKErrorDomainKeyNotMatch = -4998,
  477. /// 用户名不存在
  478. QMKErrorDomainUserNameNotFound = -4997,
  479. /// 用户id不存在
  480. QMKErrorDomainUserIdNotFound = -4996,
  481. /// 用户id不匹配
  482. QMKErrorDomainUserIdNotMatch = -4995,
  483. /// 转换地址失败
  484. QMKErrorDomainConvertAddressFail = -4994,
  485. /// 创建连接失败
  486. QMKErrorDomainCreateConnectFail = -4993,
  487. /// 鉴权失败
  488. QMKErrorDomainAcceptFail = -4992,
  489. /// 连接服务器失败
  490. QMKErrorDomainConnectServerFail = -4991,
  491. /// 服务端异常
  492. QMKErrorDomainServiceException = -4990,
  493. /// 未知错误
  494. QMKErrorDomainUnknowError = -4989,
  495. };
  496. SWIFT_PROTOCOL("_TtP9QMChatSDK19QMKRegisterDelegate_")
  497. @protocol QMKRegisterDelegate
  498. /// 注册成功
  499. - (void)registerSuccess;
  500. /// 注册失败
  501. - (void)registerFailureWithReason:(enum QMKErrorDomain)reason;
  502. @end
  503. enum QMKStatus : NSInteger;
  504. SWIFT_PROTOCOL("_TtP9QMChatSDK18QMKServiceDelegate_")
  505. @protocol QMKServiceDelegate
  506. /// 当前客服状态
  507. - (void)currentAgentStatusWithStatus:(enum QMKStatus)status;
  508. @optional
  509. /// 当前坐席信息
  510. - (void)currentAgentInfoWithAgent:(QMAgent * _Nonnull)agent;
  511. /// 当前会话排队数
  512. - (void)currentSessionWaitNumberWithNumber:(NSInteger)number;
  513. /// 邀请评价
  514. - (void)inviteEvaluate;
  515. @end
  516. typedef SWIFT_ENUM(NSInteger, QMKStatus) {
  517. /// 机器人在线
  518. QMKStatusRobot = 0,
  519. /// 客服在线
  520. QMKStatusOnline = 1,
  521. /// 客服离线
  522. QMKStatusOffline = 2,
  523. /// 客服领取会话
  524. QMKStatusClaim = 3,
  525. /// 客服结束会话
  526. QMKStatusFinish = 4,
  527. /// 专属坐席
  528. QMKStatusVip = 5,
  529. };
  530. #if __has_attribute(external_source_symbol)
  531. # pragma clang attribute pop
  532. #endif
  533. #pragma clang diagnostic pop