会话强提醒
强提醒介绍
用户在发消息的时候,可以通过在消息中携带 MsgNotice 数据字段,实现提及他人的强提醒消息(如@人)。同时接收方能在会话列表的会话摘要中,重点显示 “有人@我” 、“@所有人” 或其他的强提醒标识,用于提示用户有人在群里 @/提到 自己了。协作中台中内置了部分常见的强提醒类型(如@人),也支持接入方根据业务场景自定义强提醒类型。

获取强提醒列表
获取指定会话中,所有未读的强提醒数据列表。
接口定义
kotlin
fun getChatNotices(
chatId: String,
nextOffset: Long,
count: Int,
order: KIMCoreOrder,
noticesType: List<String>?,
callback: IResultCallback<KIMCoreChatNotices>
)
参数说明
参数 | 类型 | 说明 |
---|---|---|
chatId | string | 会话 id |
nextOffset | long | 首次传 0, 下一次传 KIMCoreChatNotices#nextOffset |
count | int | 一次查询的个数 |
isAsc | bool | 是否升序返回 |
noticesType | list string | 需要查询的强提醒类型,如果需要返回全部类型,传 null |
callback | KIMCoreChatNotices | 回调 |
下表列出了 KIMCoreNotice
中提供的主要方法
参数 | 类型 | 说明 |
---|---|---|
noticeType | string | 强提醒类型 |
noticeTarget | int | 目标类型 Constant.StrongNoticeTarget |
time | long | 该强提醒出现的时间,单位 ns |
下表列出KIMCoreChatNotice
中提供的主要方法
参数 | 类型 | 说明 |
---|---|---|
strongNoticeList | list KIMCoreNotice | 一个会话有多个 Notice 对象 |
msgId | string | notice 所属消息 id |
time | long | 消息产生的时间,单位 ns |
代码示例
kotlin
KIMCore.instance().getChatNotices(
chatId,
offset,
count,
order,
noticeType,
object : IResultCallback<KIMCoreChatNotices> {
override fun onSuccess(result: KIMCoreChatNotices?) {
TODO()
}
override fun onError(errorCode: ErrorCode) {
TODO()
}
})