NIM PC Cross Platform SDK
nim_qchat_client_def.h
Go to the documentation of this file.
1
11#ifndef __NIM_QCHAT_DEF_H__
12#define __NIM_QCHAT_DEF_H__
13
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
28};
29
32 kQChatClientTypeUnknown = 0,
45};
46
51 kLoginStepAuth // 认证阶段
52};
53
55enum NIMQChatLoginStatus {
56 kLoginStatusUnlogin = 0,
57 kLoginStatusLogging = 1,
58 kLoginStatusLogin = 2,
59 kLoginStatusKicked = 3,
60};
61
67 char* device_id;
69 char* client_ip;
71 char* consid_;
73 uint16_t client_port;
75 uint64_t timestamp;
81 char* os_name_;
82};
83
87 void* user_data;
91 uint32_t kick_reason;
93 char* ext;
96};
97
103 NIMQChatLoginStatus login_status;
104};
105
111 char* appkey;
113 char* accid;
115 char* token;
116};
117
123 uint32_t notify_type;
126};
127
134};
135
139 uint32_t res_code;
150};
151
155 uint32_t res_code;
158};
159
163 uint32_t res_code;
170};
171
175 uint32_t res_code;
179 char* token;
181 uint32_t ttl;
182};
183
184/* ------------------------------- 接口回调模板 ------------------------------- */
185
189typedef void (*nim_qchat_kicked_cb_func)(const NIMQChatKickedResp& resp);
197typedef void (*nim_qchat_login_cb_func)(const NIMQChatLoginResp& resp);
199typedef void (*nim_qchat_logout_cb_func)(const NIMQChatLogoutResp& resp);
201typedef void (*nim_qchat_kick_cb_func)(const NIMQChatKickResp& resp);
204
205/* ------------------------------- 接口所需参数 ------------------------------ */
206
213};
214
221};
222
229};
230
237};
238
247};
248
253 kNIMQChatCommEncryptionAlgorithmBase = 1,
255 kNIMQChatCommEncryptionAlgorithmRC4 = kNIMQChatCommEncryptionAlgorithmBase,
257 kNIMQChatCommEncryptionAlgorithmAES128 = kNIMQChatCommEncryptionAlgorithmBase << 1,
258 kNIMQChatCommEncryptionAlgorithmSM4 = kNIMQChatCommEncryptionAlgorithmBase << 2 // SM4 加密
259};
260
265 kNIMQChatHandShakeTypeRASRC4 // 支持RAS + RC4
266};
267
284};
285
287enum NIMQChatFCSAuthenticationType {
288 kNIMQChatFCSAuthenticationTypeRefer = 1,
289 kNIMQChatFCSAuthenticationTypeToken,
290 kNIMQChatFCSAuthenticationTypeURLToken,
291 kNIMQChatFCSAuthenticationTypeCustom
292};
293
317 NIMQChatFCSAuthenticationType fcs_auth_type;
319 char* mock_ua;
322};
323
335};
336
344 uint32_t auth_timeout;
353};
354
357
365 char* appkey;
367 char* accid;
376};
377
384};
385
396};
397
404};
405
414};
415
416#ifdef __cplusplus
417}
418#endif
419
420#endif // __NIM_QCHAT_DEF_H__
NIMQChatCustomTokenResp(* nim_qchat_custom_token_cb_func)(const NIMQChatCustomTokenResp &resp)
获取自定义token回调
Definition: nim_qchat_client_def.h:187
void(* nim_qchat_logout_cb_func)(const NIMQChatLogoutResp &resp)
登出回调
Definition: nim_qchat_client_def.h:199
void(* nim_qchat_sdk_log_cb_func)(const NIMQChatSDKLogResp &resp)
SDK日志回调
Definition: nim_qchat_client_def.h:195
void(* nim_qchat_login_status_cb_func)(const NIMQChatLoginStatusResp &resp)
登录状态回调
Definition: nim_qchat_client_def.h:191
void(* nim_qchat_kick_cb_func)(const NIMQChatKickResp &resp)
踢掉其他端回调
Definition: nim_qchat_client_def.h:201
@ kNIMQChatCommEncryptionAlgorithmRC4
RC4 加密
Definition: nim_qchat_client_def.h:255
@ kNIMQChatCommEncryptionAlgorithmAES128
AES128 加密
Definition: nim_qchat_client_def.h:257
NIMQChatHandShakeType
Definition: nim_qchat_client_def.h:262
@ kNIMQChatHandShakeTypeMulti
支持配置多种对称与非对称加密算法
Definition: nim_qchat_client_def.h:264
void(* nim_qchat_kicked_cb_func)(const NIMQChatKickedResp &resp)
接收被踢回调
Definition: nim_qchat_client_def.h:189
void(* nim_qchat_login_cb_func)(const NIMQChatLoginResp &resp)
登录回调
Definition: nim_qchat_client_def.h:197
@ kNIMQChatEncryptionAlgorithmSM2
SM2 加密
Definition: nim_qchat_client_def.h:246
@ kNIMQChatEncryptionAlgorithmRSA
RSA 加密
Definition: nim_qchat_client_def.h:244
void(* nim_qchat_multispot_login_cb_func)(const NIMQChatMultispotLoginResp &resp)
多端登录回调
Definition: nim_qchat_client_def.h:193
NIMQChatLoginStep
Definition: nim_qchat_client_def.h:48
@ kLoginStepLink
连接 Link 地址阶段
Definition: nim_qchat_client_def.h:50
NIMQChatLoginAuthType
Definition: nim_qchat_client_def.h:21
@ kNIMQChatLoginAuthTypeAppSecret
app secret鉴权方式
Definition: nim_qchat_client_def.h:25
@ kNIMQChatLoginAuthTypeAppThirdParty
基于第三方回调的token鉴权方式, 圈组暂不支持
Definition: nim_qchat_client_def.h:27
@ kNIMQChatLoginAuthTypeDefault
默认login token鉴权方式
Definition: nim_qchat_client_def.h:23
NIMQChatClientType
Definition: nim_qchat_client_def.h:31
@ kQChatClientTypeIOS
iOS
Definition: nim_qchat_client_def.h:36
@ kQChatClientTypeWP
WP.
Definition: nim_qchat_client_def.h:40
@ kQChatClientTypePC
Desktop PC (Windows/macOS/Linux)
Definition: nim_qchat_client_def.h:38
@ kQChatClientTypeWeb
Web.
Definition: nim_qchat_client_def.h:42
@ kQChatClientTypeMacOS
macOS
Definition: nim_qchat_client_def.h:44
@ kQChatClientTypeAOS
Android.
Definition: nim_qchat_client_def.h:34
void(* nim_qchat_get_rtc_token_cb_func)(const NIMQChatGetRTCTokenResp &resp)
获取RTC token回调
Definition: nim_qchat_client_def.h:203
Definition: nim_qchat_client_def.h:356
通信协议加密算法
Definition: nim_qchat_client_def.h:107
char * appkey
appkey
Definition: nim_qchat_client_def.h:111
char * accid
accid
Definition: nim_qchat_client_def.h:113
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:109
char * token
将该指针指向零结尾的token字符串的起始地址
Definition: nim_qchat_client_def.h:115
圈组协议加密配置
char * nego_key_neca_key_partb
非对称加密算法 key
Definition: nim_qchat_client_def.h:281
NIMQChatCommEncryptionAlgorithm comm_neca
通信加密算法 {1(RC4),2(AES128),4(SM4)} def:1(RC4) 对称加密
Definition: nim_qchat_client_def.h:275
uint32_t nego_key_neca_key_version
非对称加密算法的 key version
Definition: nim_qchat_client_def.h:283
NIMQChatExchangeKeyEncryptionAlgorithm nego_key_neca
"交换密钥"协议加密算法
Definition: nim_qchat_client_def.h:273
NIMQChatHandShakeType hand_shake_type
握手协议类型 0:支持配置多种对称与非对称加密算法,1:只支持RAS + RC4
Definition: nim_qchat_client_def.h:277
char * nego_key_neca_key_parta
"交换密钥"协议加密算法密钥, 为空使用默认值
Definition: nim_qchat_client_def.h:279
握手协议加密算法枚举
圈组云端数据存储配置信息
bool auto_download_video
是否自动下载视频
Definition: nim_qchat_client_def.h:313
uint32_t thumbnail_width
缩略图宽度
Definition: nim_qchat_client_def.h:299
bool auto_download_image_thumb
是否自动下载图片缩略图
Definition: nim_qchat_client_def.h:305
bool auto_download_image
是否自动下载图片
Definition: nim_qchat_client_def.h:309
NIMQChatFCSAuthenticationType fcs_auth_type
下载附件类数据的鉴权方式
Definition: nim_qchat_client_def.h:317
uint32_t thumbnail_height
缩略图高度
Definition: nim_qchat_client_def.h:301
char * mock_refer
mock refer
Definition: nim_qchat_client_def.h:321
char * mock_ua
mock user-agent
Definition: nim_qchat_client_def.h:319
bool auto_download_history_msg_attach_
是否自动下载历史消息附件
Definition: nim_qchat_client_def.h:303
bool auto_download_file
是否自动下载文件
Definition: nim_qchat_client_def.h:315
bool auto_download_video_thumb
是否自动下载视频缩略图
Definition: nim_qchat_client_def.h:307
bool auto_download_audio
是否自动下载音频
Definition: nim_qchat_client_def.h:311
Definition: nim_qchat_client_def.h:407
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:411
nim_qchat_get_rtc_token_cb_func cb
获取RTC token回调
Definition: nim_qchat_client_def.h:409
char * device_id
device_id
Definition: nim_qchat_client_def.h:413
Definition: nim_qchat_client_def.h:173
uint32_t ttl
ttl, 单位秒
Definition: nim_qchat_client_def.h:181
char * token
token
Definition: nim_qchat_client_def.h:179
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:177
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:175
Definition: nim_qchat_client_def.h:338
char * app_data_path
APP 数据存储路径,如果为空,则使用系统默认路径
Definition: nim_qchat_client_def.h:340
NIMQChatMessageChacheConfiguration message_cache_configuration
圈组消息缓存配置
Definition: nim_qchat_client_def.h:352
char * database_encrypt_key
数据库加密密钥,如果为空,则使用默认值
Definition: nim_qchat_client_def.h:346
uint32_t custom_timeout
自定义通信超时时间,单位秒, 为 0 使用默认值
Definition: nim_qchat_client_def.h:342
NIMQChatEncryptionConfiguration encrypt_configuration
圈组协议加密配置
Definition: nim_qchat_client_def.h:348
uint32_t auth_timeout
自定义鉴权超时时间,单位秒, 为 0 使用默认值
Definition: nim_qchat_client_def.h:344
NIMQChatFCSConfiguration fcs_configuration
圈组云端数据存储配置信息
Definition: nim_qchat_client_def.h:350
Definition: nim_qchat_client_def.h:387
nim_qchat_kick_cb_func cb
踢掉自己其他端回调
Definition: nim_qchat_client_def.h:389
char ** device_ids
被踢的设备id
Definition: nim_qchat_client_def.h:393
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:391
size_t device_ids_count
被踢的设备数量
Definition: nim_qchat_client_def.h:395
Definition: nim_qchat_client_def.h:161
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:163
char ** kicked_device_ids
被踢的设备id列表
Definition: nim_qchat_client_def.h:167
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:165
size_t kicked_device_ids_count
被踢的设备数量
Definition: nim_qchat_client_def.h:169
Definition: nim_qchat_client_def.h:85
NIMQChatClientType client_type
客户端类型
Definition: nim_qchat_client_def.h:89
uint32_t custom_client_type
自定义客户端类型
Definition: nim_qchat_client_def.h:95
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:87
char * ext
扩展字段
Definition: nim_qchat_client_def.h:93
uint32_t kick_reason
被踢原因
Definition: nim_qchat_client_def.h:91
Definition: nim_qchat_client_def.h:63
char * client_ip
客户端 IP
Definition: nim_qchat_client_def.h:69
char * os_name_
操作系统名称
Definition: nim_qchat_client_def.h:81
uint32_t custom_client_type_
自定义终端类型
Definition: nim_qchat_client_def.h:77
char * custom_tag_
自定义标签
Definition: nim_qchat_client_def.h:79
uint64_t timestamp
时间戳
Definition: nim_qchat_client_def.h:75
char * device_id
设备 ID
Definition: nim_qchat_client_def.h:67
uint16_t client_port
客户端端口
Definition: nim_qchat_client_def.h:73
NIMQChatClientType client_type
终端类型
Definition: nim_qchat_client_def.h:65
char * consid_
会话 ID
Definition: nim_qchat_client_def.h:71
Definition: nim_qchat_client_def.h:359
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:363
char * login_token
登陆的token
Definition: nim_qchat_client_def.h:371
char * login_ext
登录自定义字段
Definition: nim_qchat_client_def.h:373
nim_qchat_login_cb_func cb
登录异步回调
Definition: nim_qchat_client_def.h:361
char * accid
用户帐号
Definition: nim_qchat_client_def.h:367
char * appkey
app唯一标识符
Definition: nim_qchat_client_def.h:365
NIMQChatLoginAuthType auth_type
鉴权方式
Definition: nim_qchat_client_def.h:369
char * link_address
链接地址 json array
Definition: nim_qchat_client_def.h:375
Definition: nim_qchat_client_def.h:137
NIMQChatLoginStep step
操作阶段,如 Link/Auth
Definition: nim_qchat_client_def.h:141
NIMQChatLoginClientInfo client_info
客户端信息
Definition: nim_qchat_client_def.h:145
NIMQChatLoginClientInfo * other_clients
其他客户端信息
Definition: nim_qchat_client_def.h:149
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:143
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:139
size_t other_clients_count
其他客户端数量
Definition: nim_qchat_client_def.h:147
Definition: nim_qchat_client_def.h:99
NIMQChatLoginStatus login_status
登录状态
Definition: nim_qchat_client_def.h:103
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:101
Definition: nim_qchat_client_def.h:379
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:383
nim_qchat_logout_cb_func cb
登出异步回调
Definition: nim_qchat_client_def.h:381
Definition: nim_qchat_client_def.h:153
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:155
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:157
Definition: nim_qchat_client_def.h:328
size_t max_cache_channel_count
最大缓存消息得频道数量,默认缓存 100 个频道
Definition: nim_qchat_client_def.h:332
size_t max_cache_message_count
每个频道中最大缓存消息数量,默认缓存 20 条消息
Definition: nim_qchat_client_def.h:334
bool enable_message_cache
是否开启缓存消息,默认开启
Definition: nim_qchat_client_def.h:330
Definition: nim_qchat_client_def.h:119
NIMQChatLoginClientInfo client_info
客户端信息
Definition: nim_qchat_client_def.h:125
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:121
uint32_t notify_type
通知类型 1:登录 2:登出
Definition: nim_qchat_client_def.h:123
Definition: nim_qchat_client_def.h:208
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:212
nim_qchat_custom_token_cb_func cb
自定义token回调
Definition: nim_qchat_client_def.h:210
Definition: nim_qchat_client_def.h:216
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:220
nim_qchat_kicked_cb_func cb
被踢异步回调
Definition: nim_qchat_client_def.h:218
Definition: nim_qchat_client_def.h:224
nim_qchat_login_status_cb_func cb
登录状态回调
Definition: nim_qchat_client_def.h:226
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:228
Definition: nim_qchat_client_def.h:232
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:236
nim_qchat_multispot_login_cb_func cb
多端登录异步回调
Definition: nim_qchat_client_def.h:234
Definition: nim_qchat_client_def.h:399
nim_qchat_sdk_log_cb_func cb
接收日志异步回调
Definition: nim_qchat_client_def.h:401
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:403
Definition: nim_qchat_client_def.h:129
char * log_content
日志内容
Definition: nim_qchat_client_def.h:133
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:131