Interface NEMessageChannelService
-
- All Implemented Interfaces:
-
com.netease.yunxin.kit.roomkit.api.service.NEBaseService
public interface NEMessageChannelService implements NEBaseService
消息通道服务,可用于房间内自定义消息发送和接收
-
-
Method Summary
-
-
Method Detail
-
addMessageChannelListener
abstract Unit addMessageChannelListener(NEMessageChannelListener listener)
添加消息通道监听器
- Parameters:
listener- 消息监听器
-
removeMessageChannelListener
abstract Unit removeMessageChannelListener(NEMessageChannelListener listener)
移除消息通道监听器
- Parameters:
listener- 消息监听器
-
sendCustomMessage
abstract Unit sendCustomMessage(String roomUuid, String userUuid, Integer commandId, String data, NECallback<Unit> callback)
给userUuid发送自定义消息,包括房间内/房间外消息。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间ID。如果为空,不会校验对应房间以及房间成员是否存在,此时可以给房间外的用户发送消息userUuid- 用户IDcommandId- 消息类型,可用区间为 10000-19999data- 自定义的消息内容callback- 回调
-
sendCustomMessage
abstract Unit sendCustomMessage(String roomUuid, String userUuid, Integer commandId, String data, NEInjectedAuthorization injectedAuthorization, NECallback<Unit> callback)
给userUuid发送自定义消息,包括房间内/房间外消息。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间ID。如果为空,不会校验对应房间以及房间成员是否存在,此时可以给房间外的用户发送消息userUuid- 用户IDcommandId- 消息类型,可用区间为 10000-19999data- 自定义的消息内容injectedAuthorization- 鉴权信息,可空。如果为空,则使用当前登录信息去鉴权callback- 回调
-
sendCustomMessageToRoom
abstract Unit sendCustomMessageToRoom(String roomUuid, Integer commandId, String data, NECallback<Unit> callback)
向房间内发送自定义消息,如房间内信令。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间IDcommandId- 消息类型,可用区间为 10000-19999data- 自定义的消息内容callback- 回调
-
sendCustomMessageToRoom
abstract Unit sendCustomMessageToRoom(String roomUuid, Integer commandId, String data, NEInjectedAuthorization injectedAuthorization, NECallback<Unit> callback)
向房间内发送自定义消息,如房间内信令。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间IDcommandId- 消息类型,可用区间为 10000-19999data- 自定义的消息内容injectedAuthorization- 鉴权信息,可空。如果为空,则使用当前登录信息去鉴权callback- 回调
-
sendCustomMessageToRoles
abstract Unit sendCustomMessageToRoles(String roomUuid, Integer commandId, List<String> roles, String data, NECallback<Unit> callback)
向房间内指定角色的用户发送自定义消息,如房间内信令。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间IDcommandId- 消息类型,可用区间为 10000-19999roles- 角色列表,指定角色发送消息,如果为空,会向房间内所有人发送消息data- 自定义的消息内容callback- 回调
-
sendCustomMessageToRoles
abstract Unit sendCustomMessageToRoles(String roomUuid, Integer commandId, List<String> roles, String data, NEInjectedAuthorization injectedAuthorization, NECallback<Unit> callback)
向房间内指定角色的用户发送自定义消息,如房间内信令。 如果需要发送聊天消息请使用NERoomChatController。
- Parameters:
roomUuid- 房间IDcommandId- 消息类型,可用区间为 10000-19999roles- 角色列表,指定角色发送消息,如果为空,会向房间内所有人发送消息data- 自定义的消息内容injectedAuthorization- 鉴权信息,可空。如果为空,则使用当前登录信息去鉴权callback- 回调
-
queryUnreadMessageList
abstract Unit queryUnreadMessageList(String sessionId, NERoomSessionTypeEnum sessionType, NECallback<List<NERoomSessionMessage>> callback)
获取指定会话的未读消息列表
- Parameters:
sessionId- 会话idsessionType- 会话类型callback- 回调
-
clearUnreadCount
abstract Unit clearUnreadCount(String sessionId, NERoomSessionTypeEnum sessionType, NECallback<Unit> callback)
SDK 会触发 NEMessageChannelListener.onSessionMessageRecentChanged 回调通知。
- Parameters:
sessionId- 会话idsessionType- 会话类型callback- 回调
-
deleteSessionMessage
abstract Unit deleteSessionMessage(String sessionId, NERoomSessionTypeEnum sessionType, List<String> messageIdList, NECallback<Unit> callback)
SDK 会触发 NEMessageChannelListener.onSessionMessageDeleted 回调通知。
- Parameters:
sessionId- 会话idsessionType- 会话类型messageIdList- 消息id列表callback- 回调
-
deleteAllSessionMessage
abstract Unit deleteAllSessionMessage(String sessionId, NERoomSessionTypeEnum sessionType, NECallback<Unit> callback)
删除指定聊天对象和会话类型的最近会话记录,包括本地最近会话和漫游消息。<br> SDK 会触发 NEMessageChannelListener.onSessionMessageAllDeleted 回调通知。
- Parameters:
sessionId- 如果会话类型为单聊,则为聊天对象账号(accid);如果会话类型为群组或超大群,则为群组 ID。sessionType- 会话类型callback- 回调
-
getSessionMessagesHistory
abstract Unit getSessionMessagesHistory(NERoomGetSessionMessagesHistoryParam param, NECallback<List<NERoomSessionMessage>> callback)
使用前提: 已在云信控制台开启动态查询历史消息功能。
- Parameters:
param- 查询参数callback- 回调
-
-
-
-