agora_rtm_handler_t结构体 参考
RTM 事件处理回调。
结构体成员变量说明
on_rtm_data
| void(*) on_rtm_data(const char *rtm_uid, const void *msg, size_t msg_len, rtm_message_type_e msg_type, const char *custom_type) |
参数
| 参数名 | 描述 |
|---|---|
| rtm_uid [in] | 发送消息的 RTM 用户 ID。 |
| msg [in] | 收到的消息内容。 |
| msg_len [in] | 消息长度。单位为字节。 |
| msg_type [in] | 收到的 RTM 消息类型。详见 rtm_message_type_e 。 |
| custom_type [in] | 自定义消息类型;未设置时为 NULL。 |
on_rtm_event
| void(*) on_rtm_event(const char *rtm_uid, rtm_event_type_e event_type, rtm_err_code_e err_code) |
参数
| 参数名 | 描述 |
|---|---|
| rtm_uid [in] | RTM 用户 ID。 |
| event_type [in] | 事件类型。详见 rtm_event_type_e 。 |
| err_code [in] | 错误码。详见 rtm_err_code_e 。 |
on_rtm_publish_result
| void(*) on_rtm_publish_result(const char *channel_name, uint32_t msg_id, rtm_msg_state_e state) |
参数
| 参数名 | 描述 |
|---|---|
| channel_name [in] | 消息发布到的频道名称。 |
| msg_id [in] | 由应用定义的消息 ID。 |
| state [in] | RTM 消息发送状态。详见 rtm_msg_state_e 。 |
on_rtm_send_data_result
| void(*) on_rtm_send_data_result(const char *rtm_uid, uint32_t msg_id, rtm_msg_state_e state) |
参数
| 参数名 | 描述 |
|---|---|
| rtm_uid [in] | RTM 用户 ID。 |
| msg_id [in] | 消息 ID。 |
| state [in] | RTM 消息的发送状态。详见 rtm_msg_state_e 。 |
on_rtm_subscribe_data
| void(*) on_rtm_subscribe_data(const char *channel_name, const char *rtm_uid, const void *msg, size_t msg_len, rtm_message_type_e msg_type, const char *custom_type) |
参数
| 参数名 | 描述 |
|---|---|
| channel_name [in] | 收到消息的频道名称。 |
| rtm_uid [in] | 消息发送者的 RTM 用户 ID。 |
| msg [in] | 收到的消息数据。 |
| msg_len [in] | 收到的消息数据长度,单位为字节。 |
| msg_type [in] | 收到的消息类型。详见 rtm_message_type_e 。 |
| custom_type [in] | 自定义消息类型;未设置时为 NULL。 |
on_rtm_subscribe_result
| void(*) on_rtm_subscribe_result(const char *channel_name, rtm_err_code_e err_code) |
参数
| 参数名 | 描述 |
|---|---|
| channel_name [in] | 已订阅的频道名称。 |
| err_code [in] | 订阅结果。详见 rtm_err_code_e 。 |