QMChatSDK-Swift.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. // Generated by Apple Swift version 4.2 effective-3.4 (swiftlang-1000.11.37.1 clang-1000.11.45.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(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  124. # else
  125. # define SWIFT_ENUM_ATTR(_extensibility)
  126. # endif
  127. #endif
  128. #if !defined(SWIFT_ENUM)
  129. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  130. # if __has_feature(generalized_swift_name)
  131. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  132. # else
  133. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  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 Foundation;
  158. @import ObjectiveC;
  159. @import UIKit;
  160. #endif
  161. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  162. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  163. #if __has_warning("-Wpragma-clang-attribute")
  164. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  165. #endif
  166. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  167. #pragma clang diagnostic ignored "-Wnullability"
  168. #if __has_attribute(external_source_symbol)
  169. # pragma push_macro("any")
  170. # undef any
  171. # 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))
  172. # pragma pop_macro("any")
  173. #endif
  174. /// 消息属性
  175. SWIFT_CLASS("_TtC9QMChatSDK13CustomMessage")
  176. @interface CustomMessage : NSObject
  177. /// id
  178. @property (nonatomic, copy) NSString * _Null_unspecified _id;
  179. /// 设备类型
  180. @property (nonatomic, copy) NSString * _Null_unspecified device;
  181. /// 信息内容
  182. @property (nonatomic, copy) NSString * _Null_unspecified message;
  183. /// 信息类型
  184. @property (nonatomic, copy) NSString * _Nullable messageType;
  185. /// 平台类型
  186. @property (nonatomic, copy) NSString * _Null_unspecified platform;
  187. /// 记录消息的Id
  188. @property (nonatomic, copy) NSString * _Null_unspecified sessionId;
  189. /// 时间
  190. @property (nonatomic, copy) NSString * _Null_unspecified createdTime;
  191. /// 消息来源:0是发送、1是接收
  192. @property (nonatomic, copy) NSString * _Null_unspecified fromType;
  193. /// 消息发送状态 //@“0”发送成功 @“1”发送失败 2正在发送
  194. @property (nonatomic, copy) NSString * _Null_unspecified status;
  195. /// 录音时间
  196. @property (nonatomic, copy) NSString * _Null_unspecified recordSeconds;
  197. /// 新增字段 本地文件路径
  198. @property (nonatomic, copy) NSString * _Null_unspecified localFilePath;
  199. /// 新增字段 网络文件路径
  200. @property (nonatomic, copy) NSString * _Null_unspecified remoteFilePath;
  201. /// 新增字段 文件名
  202. @property (nonatomic, copy) NSString * _Null_unspecified fileName;
  203. /// 新增字段 文件大小
  204. @property (nonatomic, copy) NSString * _Null_unspecified fileSize;
  205. /// 新增字段 下载状态 “0”已下载 “1”未下载 “2”下载中
  206. @property (nonatomic, copy) NSString * _Nullable downloadState;
  207. /// 新增字段iframe类型的消息宽度
  208. @property (nonatomic, copy) NSString * _Null_unspecified width;
  209. /// 新增字段iframe类型的消息高度
  210. @property (nonatomic, copy) NSString * _Null_unspecified height;
  211. /// 新增字段 坐席工号
  212. @property (nonatomic, copy) NSString * _Null_unspecified agentExten;
  213. /// 新增字段 坐席名称
  214. @property (nonatomic, copy) NSString * _Null_unspecified agentName;
  215. /// 新增字段 坐席头像
  216. @property (nonatomic, copy) NSString * _Null_unspecified agentIcon;
  217. /// 新增字段 语音文字
  218. @property (nonatomic, copy) NSString * _Null_unspecified audioText;
  219. /// 新增字段 机器人消息
  220. @property (nonatomic, copy) NSString * _Null_unspecified isRobot;
  221. /// 新增字段 语音未读
  222. @property (nonatomic, copy) NSString * _Null_unspecified isRead;
  223. /// 新增字段 帮助状态 none useless useful
  224. @property (nonatomic, copy) NSString * _Null_unspecified isUseful;
  225. /// 问题ID
  226. @property (nonatomic, copy) NSString * _Null_unspecified questionId;
  227. @property (nonatomic, copy) NSString * _Null_unspecified richTextUrl;
  228. @property (nonatomic, copy) NSString * _Null_unspecified richTextPicUrl;
  229. @property (nonatomic, copy) NSString * _Null_unspecified richTextTitle;
  230. @property (nonatomic, copy) NSString * _Null_unspecified richTextDescription;
  231. @property (nonatomic, copy) NSString * _Null_unspecified robotType;
  232. @property (nonatomic, copy) NSString * _Null_unspecified robotId;
  233. @property (nonatomic, copy) NSString * _Null_unspecified mp3FileSize;
  234. @property (nonatomic, copy) NSString * _Null_unspecified accessid;
  235. @property (nonatomic, copy) NSString * _Null_unspecified cardImage;
  236. @property (nonatomic, copy) NSString * _Null_unspecified cardHeader;
  237. @property (nonatomic, copy) NSString * _Null_unspecified cardSubhead;
  238. @property (nonatomic, copy) NSString * _Null_unspecified cardPrice;
  239. @property (nonatomic, copy) NSString * _Null_unspecified cardUrl;
  240. @property (nonatomic, copy) NSString * _Null_unspecified userId;
  241. - (void)setValue:(id _Nullable)value forUndefinedKey:(NSString * _Nonnull)key;
  242. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  243. @end
  244. SWIFT_CLASS("_TtC9QMChatSDK7QMAgent")
  245. @interface QMAgent : NSObject
  246. /// 坐席工号
  247. @property (nonatomic, copy) NSString * _Null_unspecified exten;
  248. /// 坐席名称
  249. @property (nonatomic, copy) NSString * _Null_unspecified name;
  250. /// 坐席头像
  251. @property (nonatomic, copy) NSString * _Null_unspecified icon_url;
  252. /// 类型
  253. @property (nonatomic, copy) NSString * _Null_unspecified type;
  254. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  255. @end
  256. @protocol QMKRegisterDelegate;
  257. @protocol QMKServiceDelegate;
  258. @class NSDictionary;
  259. @class UIImage;
  260. @class NSArray;
  261. SWIFT_CLASS("_TtC9QMChatSDK9QMConnect")
  262. @interface QMConnect : NSObject
  263. /// 注册accessId、初始化SDK:
  264. /// 初始化成功,建立tcp连接,保证移动端消息的接收,如果建立tcp连接失败,会导致消息接收不到
  265. /// 以通知的方式进行回调
  266. /// param accessId: 接入客服系统的密钥, 可在客服系统登录平台获取
  267. /// param userName: 用户名, 区分用户, 用户名可直接在后台显示
  268. /// param userId: 用户ID, 区分用户
  269. + (void)registerSDKWithAppKey:(NSString * _Nonnull)accessId userName:(NSString * _Nonnull)userName userId:(NSString * _Nonnull)userId;
  270. /// 注册accessId、初始化SDK:
  271. /// 初始化成功,建立tcp连接,保证移动端消息的接收,如果建立tcp连接失败,会导致消息接收不到
  272. /// 以代理的方式进行回调
  273. /// param accessId: 接入客服系统的密钥, 可在客服系统登录平台获取
  274. /// param userName: 用户名, 区分用户, 用户名可直接在后台显示
  275. /// param userId: 用户ID, 区分用户
  276. + (void)registerSDKWithAppKey:(NSString * _Nonnull)accessId userName:(NSString * _Nonnull)userName userId:(NSString * _Nonnull)userId delegate:(id <QMKRegisterDelegate> _Nonnull)delegate;
  277. /// 注销、断开tcp连接
  278. /// 客服人员可收到用户离开的通知
  279. /// 断开后消息可以通过后台接口走离线推送
  280. + (void)logout;
  281. /// 发起新会话:
  282. /// 调用此接口、可以拥有与客服对话的能力、状态以通知的方式回调
  283. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  284. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  285. /// param failBlock: 接入会话失败回调,
  286. + (void)sdkBeginNewChatSession:(NSString * _Nonnull)peer successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  287. /// 发起新会话:
  288. /// 调用此接口、可以拥有与客服对话的能力、携带参数
  289. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  290. /// param params: 自定义参数
  291. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  292. /// param failBlock: 接入会话失败回调,
  293. + (void)sdkBeginNewChatSession:(NSString * _Nonnull)peer params:(NSDictionary<NSString *, id> * _Nonnull)params successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  294. /// 发起新会话:
  295. /// 启用日程管理的用此接口
  296. /// 调用此接口、可以拥有与客服对话的能力、携带参数
  297. /// param schedule: 日程管理所需参数,传入此参数会话才能接入对应日程管理状态
  298. /// param params: 自定义参数
  299. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  300. /// param failBlock: 接入会话失败回调,
  301. + (void)sdkBeginNewChatSessionSchedule:(NSString * _Nonnull)scheduleId processId:(NSString * _Nonnull)processId currentNodeId:(NSString * _Nonnull)currentNodeId entranceId:(NSString * _Nonnull)entranceId params:(NSDictionary<NSString *, id> * _Nonnull)params successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  302. /// 发起新会话:
  303. /// 调用此接口、可以拥有与客服对话的能力、状态以代理方法的方式回调
  304. /// param peer: 技能组ID,客服平台配置多个技能组时,需要传入对应的技能组ID,会话才能接入到对应的技能组,
  305. /// param delegate: 聊天界面的代理方法,
  306. /// param successBlock: 接入会话成功回调,回调参数为bool类型,判断后台是否开启问卷调查功能
  307. /// param failBlock: 接入会话失败回调,
  308. + (void)sdkBeginNewChatSessionWithDelegate:(NSString * _Nonnull)peer delegate:(id <QMKServiceDelegate> _Nonnull)delegate successBlock:(void (^ _Nonnull)(BOOL))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  309. /// 其他坐席服务授权
  310. /// 专属坐席未在线的情况下,是否接受其他坐席的服务
  311. /// param peer: 技能组ID, 详见beginSession接口
  312. /// param successBlock: 成功回调
  313. /// param failBlock: 失败回调
  314. + (void)sdkAcceptOtherAgentWithPeer:(NSString * _Nonnull)peer successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  315. /// 会话定时断开
  316. /// 调用此接口、可以再客户在一定时间没有新消息的时候断开会话
  317. /// param successBlock: 成功回调
  318. /// param failBlock: 回调失败
  319. + (void)sdkChatTimerBreaking:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  320. /// 获取渠道全局配置
  321. /// 调用此接口获取后台的全局配置信息,注册成功会主动请求一次插入本地plist文件,用户也可以自行调用获取
  322. /// param configs: 配置信息
  323. /// param successBlock: 成功回调
  324. /// param failBlock: 回调失败
  325. + (void)sdkGetWebchatGlobleConfig:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  326. /// 获取渠道全局配置中的 scheduleConfig
  327. /// 调用此接口获取全局配置中的 scheduleConfig 此接口主要用于开启日程管理需要
  328. /// param configs: 配置信息
  329. /// param successBlock: 成功回调
  330. /// param failBlock: 回调失败
  331. + (void)sdkGetWebchatScheduleConfig:(void (^ _Nonnull)(NSDictionary * _Nonnull))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  332. /// 发送文本消息:
  333. /// 调用此接口、可以发送文本消息,包括文字、表情
  334. /// param text: 文本消息内容
  335. /// param successBlock: 成功回调
  336. /// param failBlock: 失败回调
  337. + (void)sendMsgText:(NSString * _Nonnull)text successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  338. /// 发送图片消息:
  339. /// 调用此接口、可以发送图片消息
  340. /// param pic: 图片消息内容
  341. /// param successBlock: 成功回调
  342. /// param failBlock: 失败回调
  343. + (void)sendMsgPic:(UIImage * _Nonnull)pic successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  344. /// 发送图片消息:
  345. /// 调用此接口、可以发送图片消息
  346. /// param filePath: 图片文件相对路径
  347. /// param successBlock: 成功回调
  348. /// param failBlock: 失败回调
  349. + (void)sendMsgImage:(NSString * _Nonnull)filePath successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  350. /// 发送语音消息:
  351. /// 调用此接口、可以发送语音消息
  352. /// param audio: 语音消息路径 语音名字需要带mp3后缀
  353. /// param duration: 语音消息时长
  354. /// param successBlock: 成功回调
  355. /// param failBlock: 失败回调
  356. + (void)sendMsgAudio:(NSString * _Nonnull)audio duration:(NSString * _Nonnull)duration successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(NSString * _Nonnull))failBlock;
  357. /// 发送文件消息:
  358. /// 调用此接口、可以发送文件消息
  359. /// param fileName: 文件名称
  360. /// param filePath: 沙盒文件相对路径
  361. /// param fileSize: 文件大小
  362. /// param progressHander: 上传进度回调
  363. /// param successBlock: 成功回调
  364. /// param failBlock: 失败回调
  365. + (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;
  366. /// 发送商品信息消息:
  367. /// 调用此接口、可以发送商品信息消息
  368. /// param message: 消息字典
  369. /// param successBlock: 成功回调
  370. /// param failBlock: 失败回调
  371. + (void)sendMsgCardInfo:(NSDictionary<NSString *, NSString *> * _Nonnull)message successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  372. /// 下载消息中的文件:
  373. /// param message: 消息实例
  374. /// param localFilePath: 沙盒文件相对路径
  375. /// param progressHander: 下载进度回调
  376. /// param successBlock: 成功回调
  377. /// param failBlock: 失败回调
  378. + (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;
  379. /// 消息重发:
  380. /// 调用此接口、将未发送的消息重新发送
  381. /// param message: 消息内容
  382. /// param successBlock: 成功回调
  383. /// param failBlock: 失败回调
  384. + (void)resendMessage:(CustomMessage * _Nonnull)message successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  385. /// 封装消息模型:
  386. /// 目前只支持新增的评价类型消息(不支持文本、语音、图片等)
  387. + (CustomMessage * _Nonnull)createMessageOfInvestigations SWIFT_WARN_UNUSED_RESULT;
  388. /// 获取数据库信息:
  389. /// 调用此接口、获取数据库信息
  390. /// param num : 单次获取消息数目(无默认值)
  391. /// param [CustomMessage]: 返回消息数组
  392. + (NSArray<CustomMessage *> * _Nonnull)getDataFromDatabase:(NSInteger)number SWIFT_WARN_UNUSED_RESULT;
  393. /// 获取数据库接口、相同的accessId的数据库中的全部消息
  394. /// 调用此接口、获取数据库下同一个accessid下的全部信息
  395. /// param num : 单次获取消息数目(无默认值)
  396. /// param [CustomMessage]: 返回消息数组
  397. + (NSArray<CustomMessage *> * _Nonnull)getAccessidAllDataFormDatabase:(NSInteger)number SWIFT_WARN_UNUSED_RESULT;
  398. /// 获取数据库接口、相同的userId的数据库中的全部消息
  399. /// 调用此接口、获取数据库下同一个userId下的全部信息
  400. /// param num : 单次获取消息数目(无默认值)
  401. /// param [CustomMessage]: 返回消息数组
  402. + (NSArray<CustomMessage *> * _Nonnull)getUserIdDataFormDatabase:(NSInteger)number SWIFT_WARN_UNUSED_RESULT;
  403. /// 获取单条数据库信息:
  404. /// 调用此接口、获取数据库一条记录、用于消息重发
  405. /// param messageId: 消息ID
  406. /// param [CustomMessage]: 返回消息数组
  407. + (NSArray<CustomMessage *> * _Nonnull)getOneDataFromDatabase:(NSString * _Nonnull)messageId SWIFT_WARN_UNUSED_RESULT;
  408. /// 删除单条数据库信息:
  409. /// 用此接口、删除数据路一条记录、只能删除本地消息
  410. /// param messageId: 消息ID
  411. + (void)removeDataFromDataBase:(NSString * _Nonnull)messageId;
  412. /// 修改语音状态接口:
  413. /// 将语音由未读取状态变为已读取状态
  414. /// param messageId: 消息ID
  415. + (void)changeAudioMessageStatus:(NSString * _Nonnull)messageId;
  416. /// 撤回消息接口:
  417. /// 将发送的消息撤回,该接口只用于客服撤回消息
  418. /// param messageId: 消息ID
  419. + (void)changeDrawMessageStatus:(NSString * _Nonnull)messageId;
  420. /// 查询Mp3消息:
  421. /// 查询MP3类型文件的消息的大小
  422. /// param messageId: 消息ID
  423. + (NSString * _Nonnull)queryMp3FileMessageSize:(NSString * _Nonnull)messageId SWIFT_WARN_UNUSED_RESULT;
  424. /// 修改Mp3消息:
  425. /// 修改MP3类型文件的消息的大小
  426. /// param messageId: 消息ID
  427. /// param fileSize: 文件大小
  428. + (void)changeMp3FileMessageSize:(NSString * _Nonnull)messageId fileSize:(NSString * _Nonnull)fileSize;
  429. /// 插入商品信息展示数据
  430. /// param message: 消息字典
  431. + (void)insertCardInfoData:(NSDictionary<NSString *, NSString *> * _Nonnull)message;
  432. /// 删除商品信息展示消息
  433. + (void)deleteCardTypeMessage;
  434. /// 变更商品信息展示消息时间
  435. /// param time: 消息时间
  436. + (void)changeCardTypeMessageTime:(NSString * _Nonnull)time;
  437. /// 请求人工服务:
  438. /// 调用此接口、请求人工服务(如后台开启智能机器人功能、默认为机器人服务器)
  439. /// param successBlock: 成功回调
  440. /// param failBlock: 失败回调
  441. + (void)sdkConvertManual:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  442. /// 获取满意度评价信息:
  443. /// 用于满意度调查
  444. /// param investigateArray: 评价信息
  445. /// param successBlock: 成功回调
  446. /// param failureBlock : 失败回调
  447. + (void)sdkGetInvestigate:(void (^ _Nonnull)(NSArray * _Nonnull))successBlock failureBlock:(void (^ _Nonnull)(void))failureBlock;
  448. /// 获取技能组信息:
  449. /// 开始会话前选择技能组进入
  450. /// param investigateArray: 评价信息
  451. /// param successBlock: 成功回调
  452. /// param failureBlock: 失败回调
  453. + (void)sdkGetPeers:(void (^ _Nonnull)(NSArray * _Nonnull))successBlock failureBlock:(void (^ _Nonnull)(void))failureBlock;
  454. /// 获取未读消息数接口
  455. /// param accessId: 接入客服系统的密钥, 可在客服系统登录平台获取
  456. /// param userName: 用户名, 区分用户, 用户名可直接在后台显示
  457. /// param userId: 用户ID, 区分用户
  458. + (void)sdkGetUnReadMessage:(NSString * _Nonnull)accessId userName:(NSString * _Nonnull)userName userId:(NSString * _Nonnull)userId successBlock:(void (^ _Nonnull)(NSInteger))successBlock failureBlock:(void (^ _Nonnull)(void))failureBlock;
  459. /// 提交满意度调查信息
  460. /// param name: 评价信息
  461. /// param value: 评价信息ID
  462. /// param successBlock: 成功回调
  463. /// param failBlock: 失败回调
  464. + (void)sdkSubmitInvestigate:(NSString * _Nonnull)name value:(NSString * _Nonnull)value successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  465. /// 留言接口
  466. /// 客服离线状态下,未配置机器人客服或转人工客服时,可进行留言操作
  467. /// param phone: 联系电话
  468. /// param Email: 联系邮箱
  469. /// param message: 留言内容
  470. /// param successBlock: 成功回调
  471. /// param failBlock: 失败回调
  472. + (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;
  473. /// 留言接口
  474. /// 客服离线状态下,未配置机器人客服或转人工客服时,可进行留言操作
  475. + (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;
  476. /// 机器人反馈
  477. + (void)sdkSubmitRobotFeedback:(BOOL)isUseful questionId:(NSString * _Nonnull)questionId messageId:(NSString * _Nonnull)messageId robotType:(NSString * _Nonnull)robotType robotId:(NSString * _Nonnull)robotId successBlock:(void (^ _Nonnull)(void))successBlock failBlock:(void (^ _Nonnull)(void))failBlock;
  478. /// 自建服务器设置网络地址:
  479. /// 是不是自建服务器的用户不需要设置此项
  480. /// param tcpHost: TCP连接地址
  481. /// param tcpPort: TCP端口号
  482. /// param httpPost: HTTP请求地址
  483. + (void)setServerAddress:(NSString * _Nonnull)tcpHost tcpPort:(NSInteger)tcpPort httpPost:(NSString * _Nonnull)httpPost;
  484. + (void)setServerToken:(NSData * _Nonnull)deviceToken;
  485. /// 是否启用留言功能
  486. /// 全局配置:
  487. /// 启用留言功能,坐席不在线跳转到留言面板进行留言
  488. /// 未启用留言功能,坐席不在线,不会跳转至留言面板
  489. + (BOOL)allowedLeaveMessage SWIFT_WARN_UNUSED_RESULT;
  490. /// 留言提示窗口信息
  491. /// 全局配置:
  492. /// 未启用留言状态下,弹出的提示内容
  493. + (NSString * _Nonnull)leaveMessageAlert SWIFT_WARN_UNUSED_RESULT;
  494. /// 留言内容占位
  495. /// 全局配置:
  496. /// 启用留言状态下,展示在留言板输入框的占位提醒
  497. + (NSString * _Nonnull)leaveMessagePlaceholder SWIFT_WARN_UNUSED_RESULT;
  498. /// 留言自定义配置
  499. /// 全局配置:
  500. /// 后台留言板联系方式自定义字段
  501. + (NSArray * _Nonnull)leaveMessageContactInformation SWIFT_WARN_UNUSED_RESULT;
  502. /// 是否启用用户无响应会话自动关闭功能
  503. /// 全局配置:
  504. /// 用户长时间未给坐席发送消息,自动关闭当前会话 并退出聊天界面,需要后台正确配置 提示和断开时间
  505. + (BOOL)allowedBreakSession SWIFT_WARN_UNUSED_RESULT;
  506. /// 自动关闭会话提示语
  507. /// 全局配置:
  508. /// 后台配置的提示语,在断开前进行提示
  509. + (NSString * _Nonnull)breakSessionAlert SWIFT_WARN_UNUSED_RESULT;
  510. /// 自动关闭会话时间
  511. /// 全局配置:
  512. /// 从开始新的会话、或用户发送一条消息开始计时
  513. + (NSInteger)breakSessionDuration SWIFT_WARN_UNUSED_RESULT;
  514. /// 自动关闭会话提示时间
  515. /// 全局配置:
  516. /// 关闭会话前进行的提示的时间,从开始新的会话、或用户发送一条消息开始计时
  517. + (NSInteger)breakSessionAlertDuration SWIFT_WARN_UNUSED_RESULT;
  518. /// 判断是否启用机器人
  519. + (BOOL)allowRobot SWIFT_WARN_UNUSED_RESULT;
  520. - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
  521. @end
  522. typedef SWIFT_ENUM(NSInteger, QMKErrorDomain, closed) {
  523. /// key不存在
  524. QMKErrorDomainKeyNotFound = -4999,
  525. /// key不匹配
  526. QMKErrorDomainKeyNotMatch = -4998,
  527. /// 用户名不存在
  528. QMKErrorDomainUserNameNotFound = -4997,
  529. /// 用户id不存在
  530. QMKErrorDomainUserIdNotFound = -4996,
  531. /// 用户id不匹配
  532. QMKErrorDomainUserIdNotMatch = -4995,
  533. /// 转换地址失败
  534. QMKErrorDomainConvertAddressFail = -4994,
  535. /// 创建连接失败
  536. QMKErrorDomainCreateConnectFail = -4993,
  537. /// 鉴权失败
  538. QMKErrorDomainAcceptFail = -4992,
  539. /// 连接服务器失败
  540. QMKErrorDomainConnectServerFail = -4991,
  541. /// 服务端异常
  542. QMKErrorDomainServiceException = -4990,
  543. /// 未知错误
  544. QMKErrorDomainUnknowError = -4989,
  545. };
  546. SWIFT_PROTOCOL("_TtP9QMChatSDK19QMKRegisterDelegate_")
  547. @protocol QMKRegisterDelegate
  548. /// 注册成功
  549. - (void)registerSuccess;
  550. /// 注册失败
  551. - (void)registerFailureWithReason:(enum QMKErrorDomain)reason;
  552. @end
  553. enum QMKStatus : NSInteger;
  554. SWIFT_PROTOCOL("_TtP9QMChatSDK18QMKServiceDelegate_")
  555. @protocol QMKServiceDelegate
  556. /// 当前客服状态
  557. - (void)currentAgentStatusWithStatus:(enum QMKStatus)status;
  558. @optional
  559. /// 当前坐席信息
  560. - (void)currentAgentInfoWithAgent:(QMAgent * _Nonnull)agent;
  561. /// 当前会话排队数
  562. - (void)currentSessionWaitNumberWithNumber:(NSInteger)number;
  563. /// 邀请评价
  564. - (void)inviteEvaluate;
  565. @end
  566. typedef SWIFT_ENUM(NSInteger, QMKStatus, closed) {
  567. /// 机器人在线
  568. QMKStatusRobot = 0,
  569. /// 客服在线
  570. QMKStatusOnline = 1,
  571. /// 客服离线
  572. QMKStatusOffline = 2,
  573. /// 客服领取会话
  574. QMKStatusClaim = 3,
  575. /// 客服结束会话
  576. QMKStatusFinish = 4,
  577. /// 专属坐席
  578. QMKStatusVip = 5,
  579. };
  580. #if __has_attribute(external_source_symbol)
  581. # pragma clang attribute pop
  582. #endif
  583. #pragma clang diagnostic pop