NIM PC Cross Platform SDK
nim_subscribe_event_def.h
Go to the documentation of this file.
1
7#ifndef NIM_SDK_DLL_EXPORT_HEADERS_SUBSCRIBE_EVENT_DEF_H_
8#define NIM_SDK_DLL_EXPORT_HEADERS_SUBSCRIBE_EVENT_DEF_H_
9
10#include "public_defines.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
20static const char* kNIMEventEventType = "event_type";
22static const char* kNIMEventEventValue = "event_value";
24static const char* kNIMEventMsgIdClient = "msgid_client";
26static const char* kNIMEventConfig = "config";
28static const char* kNIMEventTTL = "ttl";
30static const char* kNIMEventBroadcastType = "broadcast_type";
32static const char* kNIMEventSyncSelf = "sync_seft";
34static const char* kNIMEventTTLType = "ttltype";
36static const char* kNIMEventDurable = "durable";
38static const char* kNIMEventEventTime = "event_time";
40static const char* kNIMEventMsgIdServer = "msgid_server";
42static const char* kNIMEventClientType = "client_type";
44static const char* kNIMEventNimConfig = "nim_config";
46static const char* kNIMEventMultiConfig = "multi_config";
48static const char* kNIMEventPublisherAccid = "publisher_accid";
50static const char* kNIMEventConsid = "consid"; // 事件信息Json Keys
52
57static const char* kNIMEventNimConfigOnlineClient = "online"; // 在线状态事件kNIMEventNimConfig字段Json Keys,只用于在线状态事件
59
64static const char* kNIMEventSubscribeEventType = "type";
66static const char* kNIMEventSubscribeTTL = "ttl";
68static const char* kNIMEventSubscribeSyncEvent = "syncevent";
69
71static const char* kNIMEventSubscribePublisherAccid = "publisher_accid";
73static const char* kNIMEventSubscribeSubscribeAccid = "subscribe_accid";
75static const char* kNIMEventSubscribeSubscribeTime = "subscribe_time"; // 事件订阅信息Json Keys
77
84};
85
92};
93
100};
101
110};
111
125
134typedef void (*nim_push_event_cb_func)(int res_code, const char* event_info_json, const char* json_extension, const void* user_data);
135
144typedef void (*nim_batch_push_event_cb_func)(int res_code, const char* event_list_json, const char* json_extension, const void* user_data);
145
156typedef void (
157 *nim_publish_event_cb_func)(int res_code, int event_type, const char* event_info_json, const char* json_extension, const void* user_data);
158
169typedef void (
170 *nim_subscribe_event_cb_func)(int res_code, int event_type, const char* faild_list_json, const char* json_extension, const void* user_data);
171
182typedef void (
183 *nim_unsubscribe_event_cb_func)(int res_code, int event_type, const char* faild_list_json, const char* json_extension, const void* user_data);
184
193typedef void (*nim_batch_unsubscribe_event_cb_func)(int res_code, int event_type, const char* json_extension, const void* user_data);
194
205typedef void (*nim_query_subscribe_event_cb_func)(int res_code,
206 int event_type,
207 const char* subscribe_list_json,
208 const char* json_extension,
209 const void* user_data);
210
221typedef void (*nim_batch_query_subscribe_event_cb_func)(int res_code,
222 int event_type,
223 const char* subscribe_list_json,
224 const char* json_extension,
225 const void* user_data);
226
227#ifdef __cplusplus
228}
229#endif
230
231#endif // NIM_SDK_DLL_EXPORT_HEADERS_SUBSCRIBE_EVENT_DEF_H_
static const char * kNIMEventEventType
int,事件类型
Definition: nim_subscribe_event_def.h:20
void(* nim_batch_query_subscribe_event_cb_func)(int res_code, int event_type, const char *subscribe_list_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:221
NIMEventOnlineStateValue
Definition: nim_subscribe_event_def.h:113
@ kNIMEventOnlineStateValueUpdateConfig
自己的其他端更新了自己端的multi_config信息
Definition: nim_subscribe_event_def.h:123
@ kNIMEventOnlineStateValueLogout
登出
Definition: nim_subscribe_event_def.h:117
@ kNIMEventOnlineStateValueCustom
在线状态事件服务器保留1~9999的事件值,客户端自定义事件值需大于9999
Definition: nim_subscribe_event_def.h:121
@ kNIMEventOnlineStateValueDisconnect
断开连接
Definition: nim_subscribe_event_def.h:119
@ kNIMEventOnlineStateValueLogin
登录
Definition: nim_subscribe_event_def.h:115
NIMEventType
Definition: nim_subscribe_event_def.h:103
@ kNIMEventTypeCustom
服务器保留1~99999的事件类型,客户端自定义事件类型需大于99999
Definition: nim_subscribe_event_def.h:109
@ kNIMEventTypeOnlineState
在线状态事件(客户端可发送)
Definition: nim_subscribe_event_def.h:105
@ kNIMEventTypeSyncEvent
同步“订阅事件”事件(客户端不可发送)
Definition: nim_subscribe_event_def.h:107
static const char * kNIMEventSubscribeTTL
long,订阅有效期,单位:秒,范围:60s到30天
Definition: nim_subscribe_event_def.h:66
static const char * kNIMEventSubscribeSyncEvent
int,订阅后是否立即同步最新事件
Definition: nim_subscribe_event_def.h:68
static const char * kNIMEventTTL
long,事件有效期,单位:秒,时间范围:60s到7天
Definition: nim_subscribe_event_def.h:28
static const char * kNIMEventBroadcastType
int,事件广播类型:1:仅在线 2:在线和离线
Definition: nim_subscribe_event_def.h:30
static const char * kNIMEventMsgIdClient
string,客户端生成的消息id
Definition: nim_subscribe_event_def.h:24
NIMEventSyncType
Definition: nim_subscribe_event_def.h:87
@ kNIMEventSyncTypeSelf
事件同步给自己其他端
Definition: nim_subscribe_event_def.h:91
@ kNIMEventSyncTypeNoSelf
事件不同步给自己其他端
Definition: nim_subscribe_event_def.h:89
void(* nim_query_subscribe_event_cb_func)(int res_code, int event_type, const char *subscribe_list_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:205
static const char * kNIMEventNimConfigOnlineClient
string,预定义事件的扩展字段中的在线的客户端类型
Definition: nim_subscribe_event_def.h:57
static const char * kNIMEventMsgIdServer
string,服务端生成的消息id(客户端不填写)
Definition: nim_subscribe_event_def.h:40
static const char * kNIMEventSubscribeSubscribeTime
long,订阅时间戳(客户端不填写)
Definition: nim_subscribe_event_def.h:75
void(* nim_subscribe_event_cb_func)(int res_code, int event_type, const char *faild_list_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:170
NIMEventBroadcastType
Definition: nim_subscribe_event_def.h:79
@ kNIMEventBroadcastTypeAll
在线和离线
Definition: nim_subscribe_event_def.h:83
@ kNIMEventBroadcastTypeOnline
仅在线
Definition: nim_subscribe_event_def.h:81
static const char * kNIMEventMultiConfig
string,多端配置信息字段,JSON格式{"clent_type":"clent_config","1":"xxx","2":"xxx"}
Definition: nim_subscribe_event_def.h:46
static const char * kNIMEventClientType
int,发送客户端类型(客户端不填写)
Definition: nim_subscribe_event_def.h:42
static const char * kNIMEventEventValue
int,事件值
Definition: nim_subscribe_event_def.h:22
static const char * kNIMEventDurable
int,是否需要持久化(可选字段),默认为需要持久化,0:不需要持久化,1:需要持久化(客户端不填写)
Definition: nim_subscribe_event_def.h:36
NIMEventSubscribeSyncEventType
Definition: nim_subscribe_event_def.h:95
@ kNIMEventSubscribeSyncTypeSync
订阅后立即同步最新事件
Definition: nim_subscribe_event_def.h:99
@ kNIMEventSubscribeSyncTypeUnSync
订阅后不同步最新事件
Definition: nim_subscribe_event_def.h:97
static const char * kNIMEventSubscribeSubscribeAccid
string,订阅人的accid(客户端不填写)
Definition: nim_subscribe_event_def.h:73
static const char * kNIMEventSubscribePublisherAccid
string,被订阅人(事件发布人)的accid(客户端不填写)
Definition: nim_subscribe_event_def.h:71
static const char * kNIMEventPublisherAccid
string,事件发布者的accid(客户端不填写)
Definition: nim_subscribe_event_def.h:48
static const char * kNIMEventNimConfig
string,预定义事件的扩展字段(在线状态事件:在线的客户端类型Json
Definition: nim_subscribe_event_def.h:44
static const char * kNIMEventSyncSelf
int,0:不同步给自己的其他端,1:同步给自己的其他端
Definition: nim_subscribe_event_def.h:32
void(* nim_unsubscribe_event_cb_func)(int res_code, int event_type, const char *faild_list_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:183
void(* nim_batch_push_event_cb_func)(int res_code, const char *event_list_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:144
void(* nim_publish_event_cb_func)(int res_code, int event_type, const char *event_info_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:157
static const char * kNIMEventTTLType
int,TtlType枚举值(客户端不填写)
Definition: nim_subscribe_event_def.h:34
static const char * kNIMEventSubscribeEventType
int,事件类型
Definition: nim_subscribe_event_def.h:64
static const char * kNIMEventConfig
string,用户自定义事件扩展属性,最长4K
Definition: nim_subscribe_event_def.h:26
static const char * kNIMEventEventTime
long,事件发布的时间戳,服务器补充(客户端不填写)
Definition: nim_subscribe_event_def.h:38
static const char * kNIMEventConsid
string,发送设备id(客户端不填写)
Definition: nim_subscribe_event_def.h:50
void(* nim_push_event_cb_func)(int res_code, const char *event_info_json, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:134
void(* nim_batch_unsubscribe_event_cb_func)(int res_code, int event_type, const char *json_extension, const void *user_data)
Definition: nim_subscribe_event_def.h:193
NIM SDK 及 NIM ChatRoom SDK 公用头文件