类/枚举

更新时间: 2025/09/03 10:41:51

本文介绍网易云信即时通讯 SDK(简称 NIM SDK)客户端接口类和枚举信息。

NIMResult

操作结果回调。T 表示操作返回的数据类型。

dartNIMResult.success({String? message, dynamic data}) : this(0, data, message);
NIMResult.failure({int code = -1, String? message})
    : this(code, null, message);
NIMResult(this.code, this.data, this.errorDetails);
factory NIMResult.fromMap(Map<String, dynamic> map,
    {NIMResultDataConvert<T>? convert}) {
  var data = map['data'];
  var code = map['code'];
  var errorDetails = map['errorDetails'];
  if (data != null && convert != null) {
    final result = NIMResult(
        code, convert(Map<String, dynamic>.from(data)), errorDetails);
    assert(() {
      result._sourceMap = map;
      return true;
    }());
    return result;
  } else {
    return NIMResult(code, data as T?, errorDetails);
  }
}

成员函数

  • success:操作成功回调
  • failure:操作失败回调
  • fromMap:数据转换回调
  • 错误信息,具体错误码请参考 API 错误码文档

NIMError

错误信息。具体错误码请参考 API 错误码文档。

DartNIMError({
int? code,
String? desc,
Map<String, dynamic>? detail,
})
参数名称 类型 说明
code int 错误码。
desc String 错误描述。
detail Map 错误详情,用于补充上下文细节。

NIMLoginOption

登录配置参数。

dartNIMLoginOption({
int? retryCount,
int? timeout,
NIMLoginAuthType? authType,
bool? forceMode,
NIMDataSyncLevel? syncLevel,
bool extensionProvider = false,
bool tokenProvider = false,
})
名称 类型 是否必填 默认值 说明
retryCount int 3 登录失败后,重试登录的次数。
若登录成功后因网络原因断开连接,则不限次数重连。
timeout int 60000 登录超时时间,单位毫秒。
系统会在超时时间内重试登录,重试次数最大为 retryCount

forceMode

bool

false

多端登录互踢时,是否强制登录:

  • true:强制登录模式。设置为该模式后,如果在 网易云信控制台 上配置了 多端登录互踢策略,则无论本端是否为登录存续状态(未登出但退出应用),登录成功时将其他在线设备端踢下线。
  • false:非强制登录模式。设置为该模式后,如果在 网易云信控制台 上配置了 多端登录互踢策略
  • 如果本端为登录存续状态,本端登录失败且返回 417 错误码(禁止多端登录)。此时可决定再次登录并设置强制登录模式或放弃登录。
  • 如果本端为非登录存续状态,则登录成功时将其他在线设备端踢下线。
authType NIMLoginAuthType 0 鉴权方式,包括静态 Token 鉴权(默认)、动态 Token 鉴权、通过第三方回调鉴权。
syncLevel NIMDataSyncLevel - 数据同步模式,分为完全同步和基础数据同步。
tokenProvider bool false 是否设置动态 token。(用户无需设置)
loginExtensionProvider bool false 是否设置动态扩展信息。(用户无需设置)

NIMLoginClient

当前处于登录状态的客户端信息对象。

dartNIMLoginClient({
NIMLoginClientType? type,
String? clientId,
String? os,
int? customClientType,
String? customTag,
int? timestamp,
String? clientIP,
})
参数名称 类型 是否只读 说明
type NIMLoginClientType 客户端类型。
clientId String 客户端 ID,客户端唯一标识。
os String 客户端操作系统。
customClientType int 自定义客户端类型,小于或等于 0 表示无自定义类型,默认为 0。
customTag String 自定义标签,不得超过 32 个字符。可以通过该参数对不同终端设备进行区分。
timestamp int 客户端登录时间戳。
clientIP String 登录客户端的 IP 信息。

NIMKickedOfflineDetail

登录客户端被踢详细信息对象。

dartNIMKickedOfflineDetail({
  int? customClientType,
  NIMLoginClientType? clientType,
  NIMKickedOfflineReason? reason,
  String? reasonDesc,
})
参数名称 类型 说明
reason NIMKickedOfflineReason 客户端被踢原因类型。
reasonDesc String 客户端被踢原因详情。
clientType NIMLoginClientType 踢端的客户端类型。
customClientType int 踢端自定义客户端类型。

NIMDataSyncDetail

数据同步状态详细信息对象。

dartNIMDataSyncDetail({
  NIMDataSyncType? type,
  NIMDataSyncState? state,
})
参数名称 类型 说明
type NIMDataSyncType 同步数据类型。
state NIMDataSyncState 同步数据状态类型。

NIMLoginClientChangeEvent

登录客户端变更事件。

dartNIMLoginClientChangeEvent({
NIMLoginClientChange? change,
List<NIMLoginClient>? clients,
})
参数名称 类型 说明
change NIMLoginClientChange 客户端登录状态变更原因。
clients List<NIMLoginClient> 登录的客户端。

NIMConversationOption

会话查询选项。

dartNIMConversationOption({
  required List<NIMConversationType> conversationTypes,
  required bool onlyUnread,
  required List<String> conversationGroupIds,
})
名称 类型 是否必填 默认值 说明
conversationTypes List<NIMConversationType> [] 或 null 会话类型,null 表示不限制会话类型。
onlyUnread bool false 是否仅查询未读会话:
  • true:仅查询未读会话
  • false:查询所有会话。
  • conversationGroupIds List<String> null 会话分组 ID 列表。null 表示查询所有会话分组,empty 表示查询未添加到会话分组的会话。

    NIMConversationResult

    会话查询结果。

    dartNIMConversationResult({
      List<NIMConversation>? conversationList,
      required int offset,
      required bool finished,
    })
    
    名称 类型 是否只读 说明
    offset int 分页偏移。
    finished bool 数据是否获取完毕:
  • true:获取完毕
  • false:未获取完毕,需要继续调用方法获取。
  • conversationList List<NIMConversation> 会话对象列表。

    NIMConversation

    会话对象。

    dartNIMConversation({
    required String conversationId,
    required NIMConversationType type,
    String? name,
    String? avatar,
    required bool mute,
    required bool stickTop,
    List<String>? groupIds,
    String? localExtension,
    String? serverExtension,
    NIMLastMessage? lastMessage,
    int? unreadCount,
    int? sortOrder,
    required int createTime,
    required int updateTime,
    })
    
    名称 类型 是否只读 默认值 说明
    conversationId String - 会话 ID,通过调用 ConversationIdUtil 的对应函数创建。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    type NIMConversationType unknown 会话类型。
    name String null 会话名称。
  • 如果会话类型为单聊,则为聊天对象的用户名(好友备注/用户名称/用户账号)。
  • 如果会话类型为群组或超大群,则为群组名(群组名称/群组 ID)。
  • avatar String null 会话头像。
  • 如果会话类型为单聊,则为聊天对象的头像。
  • 如果会话类型为群组或超大群,则为群组头像。
  • mute bool null 会话是否为静音状态。
    stickTop bool false 会话是否为置顶状态。
    groupIds List<String> null 会话所属分组列表。
    localExtension String "" 会话本地扩展字段,不会多端同步。长度上限为 1024 字节。
    serverExtension String "" 会话服务端扩展字段,多端同步。长度上限为 1024 字节。
    lastMessage NIMLastMessage null 会话中最后一条消息。
    unreadCount int 0 会话消息未读数。
    createTime int 0 会话创建时间戳(毫秒)。
    updateTime int 0 会话更新时间戳(毫秒)。
    sortOrder int 0 会话排序字段。默认将置顶会话排首位,如有多条置顶会话,则按其创建时间进行排序。

    NIMConversationFilter

    会话过滤器对象。

    dartNIMConversationFilter({
      List<NIMConversationType>? conversationTypes,
      String? conversationGroupId,
      bool? ignoreMuted,
    })
    
    名称 类型 是否必填 默认值 说明
    conversationTypes List<NIMConversationType> null 会话类型列表,null 表示不按照会话类型过滤。
    conversationGroupId String null 会话分组 ID,null 表示不按照会话 ID 过滤。
    ignoreMuted bool false 是否过滤具有免打扰属性(mutetrue)的会话对象:
  • true:过滤免打扰的会话
  • false:不过滤免打扰的会话。
  • NIMConversationOperationResult

    单条会话操作结果。

    dartNIMConversationOperationResult({
      String? conversationId,
      NIMError? error,
    })
    
    名称 类型 是否只读 说明
    conversationId String 操作失败的会话 ID。如果操作成功则为空。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    error NIMError 操作失败的错误码和错误信息,如果操作成功,则为空。

    NIMConversationUpdate

    会话更新对象。

    dartNIMConversationUpdate({
      required String serverExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    serverExtension String "" 服务端扩展字段,多端同步。长度上限为 1024 字节。

    ConversationIdUtil

    会话 ID 构建工具。

    成员函数

    • p2pConversationId

      构造单聊会话 ID。

      参数名称 类型 说明
      accountId String 聊天对象账号
    • teamConversationId

      构造群聊(高级群)会话 ID。

      参数名称 类型 说明
      teamId String 高级群的群组 ID
    • superTeamConversationId

      构造群聊(超大群)会话 ID。

      参数名称 类型 说明
      superTeamId String 超大群的群组 ID
    • conversationType

      解析会话类型。提取拼接的中间段。

      参数名称 类型 说明
      conversationId String 会话 ID

      返回值:NIMConversationType

    • conversationTargetId

      解析会话目标账号。提取拼接的最后一段。

      参数名称 类型 说明
      conversationId String 会话 ID

      返回值:String targetId

    NIMMessage

    单聊、群组会话内消息对象。

    dartNIMMessage({
    bool? isSelf,
    NIMMessageAttachmentUploadState? attachmentUploadState,
    NIMMessageSendingState? sendingState,
    NIMMessageType? messageType,
    int? subType,
    String? text,
    NIMMessageAttachment? attachment,
    String? serverExtension,
    String? localExtension,
    String? callbackExtension,
    NIMMessageConfig? messageConfig,
    NIMMessagePushConfig? pushConfig,
    NIMMessageRouteConfig? routeConfig,
    NIMMessageAntispamConfig? antispamConfig,
    NIMMessageRobotConfig? robotConfig,
    NIMMessageRefer? threadRoot,
    NIMMessageRefer? threadReply,
    NIMMessageAIConfig? aiConfig,
    NIMMessageStatus? messageStatus,
    int? modifyTime,
    String? modifyAccountId,
    })
    
    名称 类型 是否只读 说明
    isSelf bool 消息发送方是否为本人。
    attachmentUploadState NIMMessageAttachmentUploadState 消息附件上传状态。
    sendingState NIMMessageSendingState 消息发送状态。
    messageType NIMMessageType 消息类型。
    subType int 自定义消息子类型,0 表示无消息子类型。
    text String 消息文本内容,仅文本类型的消息有该字段。
    attachment NIMMessageAttachment 消息附件,仅图片、语音、视频、文件类型消息有该字段。长度限制与各套餐的配置(消息 attach 字段大小上限)有关,具体请参考 字段限制说明
    serverExtension String 消息服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    localExtension String 消息本地扩展字段,必须为 JSON 格式封装,不可多端同步。长度上限为 2048 字节。默认为空("")。
    callbackExtension String 第三方回调透传的自定义扩展字段,长度上限为 2048 字节。
    第三方回调功能需要在 网易云信控制台开通
    messageConfig NIMMessageConfig 消息相关配置。
    pushConfig NIMMessagePushConfig 第三方推送相关配置。
    第三方推送功能需要在 网易云信控制台配置
    routeConfig NIMMessageRouteConfig 消息事件抄送相关配置。
    消息抄送功能需要在 网易云信控制台开通
    antispamConfig NIMMessageAntispamConfig 反垃圾相关配置。
    反垃圾功能包括客户端反垃圾和安全通,均需要在 网易云信控制台开通
    robotConfig NIMMessageRobotConfig 机器人相关配置。
    机器人功能需要在 网易云信控制台配置
    threadRoot NIMMessageRefer 消息回复的根消息参考信息。
    消息回复功能需要在 网易云信控制台开通
    threadReply NIMMessageRefer 消息回复的父消息参考信息。
    消息回复功能需要在 网易云信控制台开通
    aiConfig NIMMessageAIConfig 数字人相关的 AI 聊天信息。
    messageStatus NIMMessageStatus 消息状态相关信息。
    modifyTime int 消息更新是时间,默认为 0。
    modifyAccountId String 消息更新者账号,默认为 null/undefined。

    NIMMessageFilter

    消息过滤器。

    dartNIMMessageFilter = Future<bool> Function(
    NIMMessage message
    )
    NIMMessageFilter? shouldIgnore;
    

    回调函数

    • shouldIgnore

      该消息是否过滤。返回 true 表示需要过滤该消息,false 表示不过滤。

      参数名称 类型 是否只读 说明
      message NIMMessage 当前接收到的消息。

    NIMMessageStatus

    消息状态对象,包含消息发送失败的错误码以及是否已发送过已读回执。

    dartNIMMessageStatus({
    int? errorCode,
    bool? readReceiptSent,
    })
    
    名称 类型 是否必填 默认值 说明
    errorCode int 200 消息发送失败的错误码。用户可以对该错误码做详细处理,以适配上层业务。
    • 当错误码由客户端回填时,发送状态为失败。
    • 当错误码由服务端回填时,发送状态为成功,服务端会返回对应的提示。
    • 当发生以下情况时,会返回错误码:
      • 本地命中反垃圾拦截
      • 本地发送超时
      • 服务器 AI 响应消息由于反垃圾失败返回
      • 服务器 AI 响应消息由于三方回调拦截返回
      • 被对方拉黑发送失败
      • 其他发送失败情况,如文件上传失败,文件上传取消
    readReceiptSent bool false 是否已发送过已读回执。当用户开启群消息已读回执时,客户端收到消息后需要发送已读回执请求,为了避免重复发送,需要通过该字段判断是否已发送过已读回执。该字段只对群消息有效。

    NIMMessageConfig

    消息相关配置。

    dartNIMMessageConfig({
    bool? readReceiptEnabled,
    bool? lastMessageUpdateEnabled,
    bool? historyEnabled,
    bool? roamingEnabled,
    bool? onlineSyncEnabled,
    bool? offlineEnabled,
    bool? unreadEnabled,
    })
    
    名称 类型 是否必填 默认值 说明
    readReceiptEnabled bool false 是否需要消息已读回执信息。
    lastMessageUpdateEnabled bool true 是否需要更新消息所属的会话信息。
    historyEnabled bool true 是否需要在服务端保存历史消息。
    roamingEnabled bool true 是否需要保存漫游消息。
    onlineSyncEnabled bool true 是否需要发送方消息多端同步。
    offlineEnabled bool true 是否需要保存离线消息。
    unreadEnabled bool true 是否需要计入未读数。

    NIMMessagePushConfig

    消息第三方推送相关配置。

    dartNIMMessagePushConfig({
    bool? pushEnabled,
    bool? pushNickEnabled,
    String? pushContent,
    String? pushPayload,
    bool? forcePush,
    String? forcePushContent,
    List<String?>? forcePushAccountIds,
    })
    
    名称 类型 是否必填 默认值 说明
    pushEnabled bool true 是否需要推送消息。
    pushNickEnabled bool true 是否需要推送消息发送方昵称。
    pushContent String 云信内置的推送文案 推送文案。
    pushPayload String - 推送 Payload
    forcePush bool false 是否忽略用户消息提醒相关设置,强制推送。该字段仅对群消息有效。
    forcePushContent String - 强制推送文案。
    forcePushAccountIds List<String> - 强制推送目标账号列表。

    NIMMessageRouteConfig

    消息事件抄送相关配置。

    dartNIMMessageRouteConfig({
    bool? routeEnabled,
    String? routeEnvironment,
    })
    
    名称 类型 是否必填 默认值 说明
    routeEnabled bool true 是否需要消息事件抄送。
    routeEnvironment String routeEnabled 为 true 则为必填 - 环境变量,用于指向不同消息事件抄送、第三方回调等配置。

    NIMMessageAntispamConfig

    消息反垃圾配置,包括客户端本地反垃圾和安全通的相关配置。

    dartNIMMessageAntispamConfig({
    bool? antispamEnabled,
    String? antispamBusinessId,
    String? antispamCustomMessage,
    String? antispamCheating,
    String? antispamExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    antispamEnabled bool true 是否对该消息启用安全通检测。
    antispamBusinessId String antispamEnabled 为 true 时必填 - 易盾业务 ID
    antispamCustomMessage String antispamEnabled 为 true 时必填 - 自定义消息中需要反垃圾的内容,必须是 JSON 格式,长度不超过 5000 字节。格式如下 { "type": 1, //1:文本,2:图片,3 视频 "data": "" //文本内容 or 图片地址 or 视频地址 }
    antispamCheating String antispamEnabled 为 true 时必填 - 易盾反作弊(辅助检测数据),必须为 JSON 格式,长度上限为 1024 字节。
    antispamExtension String antispamEnabled 为 true 时必填 - 易盾反垃圾(增强检测数据),必须为 JSON 格式,长度上限为 1024 字节。

    NIMMessageRobotConfig

    消息机器人相关配置。

    dartNIMMessageRobotConfig({
    String? accountId,
    String? topic,
    String? function,
    String? customContent,
    })
    
    名称 类型 是否必填 默认值 说明
    accountId String - 机器人账号,必须与在 网易云信控制台 上配置的机器人账号一致。
    该字段仅对群组消息有效。
    topic String - 机器人消息话题。
    function String - 机器人具体功能。
    customContent String - 机器人自定义内容。

    NIMLastMessage

    会话最后一条消息。包含以下场景:

    • 发送的最后一条消息
    • 接收的最后一条消息
    • 插入的最后一条消息
    • 撤回消息的通知
    dartNIMLastMessage({
    NIMLastMessageState? lastMessageState,
    NIMMessageRefer? messageRefer,
    NIMMessageType? messageType,
    int? subType,
    NIMMessageSendingState? sendingState,
    String? text,
    NIMMessageAttachment? attachment,
    String? revokeAccountId,
    NIMMessageRevokeType? revokeType,
    String? serverExtension,
    String? callbackExtension,
    String? senderName,
    })
    
    名称 类型 是否只读 说明
    lastMessageState NIMLastMessageState 最后一条消息状态。
    messageRefer NIMMessageRefer 最后一条消息的参考信息。
    messageType NIMMessageType 消息类型,消息状态为正常时该字段有效。
    subType int 自定义消息子类型,0 代表无消息子类型。消息状态为正常时该字段有效。
    sendingState NIMMessageSendingState 消息发送状态。消息状态为正常时该字段有效。
    text String 文本消息的内容或撤回消息时的附言。
    attachment NIMMessageAttachment 消息附件。消息状态为正常时该字段有效。
    revokeAccountId String 消息撤回者账号(accountId)。消息状态为撤回时该字段有效。
    revokeType NIMMessageRevokeType 消息撤回类型。消息状态为撤回时该字段有效。
    serverExtension String 服务端扩展字段,多端同步。
    callbackExtension String 第三方回调透传的自定义扩展字段。
    第三方回调功能需要在 网易云信控制台开通
    senderName String 消息发送者名称(好友备注/群成员昵称/用户昵称)
  • 若最后一条消息被撤回,则为撤回者相关名称。
  • 若当前账号为发送者,则该字段不存在。
  • NIMMessageQuickComment

    消息快捷评论对象。

    dartNIMMessageQuickComment({
    NIMMessageRefer? messageRefer,
    String? operatorId,
    int? index,
    int? createTime,
    String? serverExtension,
    })
    
    名称 类型 是否只读 说明
    messageRefer NIMMessageRefer 快捷评论的消息的参考信息。
    operatorId String 评论操作人账号(accountId),默认为空。
    index int 快捷评论索引,默认为 0。
    createTime int 评论时间戳。
    serverExtension String 服务端扩展字段,多端同步。

    NIMMessageQuickCommentPushConfig

    快捷评论推送配置。

    dartNIMMessageQuickCommentPushConfig({
    bool? pushEnabled,
    bool? needBadge,
    String? pushTitle,
    String? pushContent,
    String? pushPayload,
    })
    
    名称 类型 是否必填 说明
    pushEnabled bool 是否需要推送,默认为 true。
    needBadge bool 是否需要角标,默认为 true。
    pushTitle String 推送标题。
    pushContent String 推送内容。
    pushPayload String 推送自自定义字段。

    NIMMessagePin

    Pin 消息对象。

    dartNIMMessagePin({
    NIMMessageRefer? messageRefer,
    String? operatorId,
    String? serverExtension,
    int? createTime,
    int? updateTime,
    })
    
    名称 类型 是否只读 说明
    messageRefer NIMMessageRefer Pin 消息的参考信息。
    operatorId String 操作人账号(accountId),默认为空。
    createTime int Pin 消息时间戳。
    updateTime int 更新 Pin 消息时间戳。
    serverExtension String 服务端扩展字段,多端同步。

    NIMCollection

    消息收藏对象。

    dartNIMCollection({
    String? collectionId,
    int? collectionType,
    String? collectionData,
    String? serverExtension,
    int? createTime,
    int? updateTime,
    String? uniqueId,
    })
    
    名称 类型 是否只读 说明
    collectionId String 服务器消息收藏 ID
    collectionType int 自定义收藏类型,必须大于 0,默认为 0。
    collectionData String 收藏数据,上限为 20480 字节。
    createTime int 收藏时间戳。
    updateTime int 更新收藏时间戳。
    serverExtension String 服务端扩展字段,多端同步。长度上限为 1024 字节。
    uniqueId String 去重唯一 ID,如果 ID 相同,则不会新增收藏,只更新之前的收藏内容。

    NIMAddCollectionParams

    消息收藏配置参数。

    dartNIMAddCollectionParams({
    int? collectionType,
    String? collectionData,
    String? serverExtension,
    String? uniqueId,
    })
    
    名称 类型 是否必填 默认值 说明
    collectionType int - 自定义收藏类型,必须大于 0,否则返回 191004 参数错误。
    collectionData String - 收藏数据,上限为 20480 字节。
    serverExtension String - 服务端扩展字段。必须为 JSON 格式封装,多端同步,长度上限为 1024 字节。
    uniqueId String - 去重唯一 ID,如果 ID 相同,则不会新增收藏,只更新之前的收藏内容。

    NIMCollectionOption

    分页查询消息收藏选项。

    dartNIMCollectionOption({
    int? beginTime,
    int? endTime,
    NIMQueryDirection? direction,
    NIMCollection? anchorCollection,
    int? limit,
    int? collectionType,
    })
    
    名称 类型 是否必填 默认值 说明
    beginTime int 0 查询开始时间。该字段必须小于等于 endTime
    endTime int 0 查询结束时间。该字段必须大于等于 beginTime,默认为系统当前时间。
    anchorCollection NIMCollection> - 查询的消息锚点。查询结果不包含该锚点消息。
  • 该字段为空,则以 [beginTime,endTime] 为查询范围。
  • 该字段不为空:
    • directionDESC,如果 endTime 为 0,则以 anchorCollection 对应的时间戳为准。如果 endTime 不为 0,则必须与 anchorCollection 时间相同,否则返回 191004 参数错误。
    • directionASC,如果 beginTime 为 0,则以 anchorCollection 的时间戳为准。如果 beiginTime 不为 0,则必须与 anchorCollection 时间相同,否则返回 191004 参数错误。
  • direction NIMQueryDirection desc 查询方向:按照时间升序或降序。
    limit int 100 本次查询条数上限,取值范围为 [0,200)。大于等于 200 则返回 191004 参数错误,小于 0 则默认为 100。
    collectionType int 0,即查询所有类型 收藏类型。

    NIMCollectionListResult

    分页查询收藏信息结果。

    dartNIMCollectionListResult({
    int? totalCount,
    List<NIMCollection>? collectionList,
    })
    
    名称 类型 是否只读 默认值 说明
    totalCount int - 总收藏条数。
    collectionList List<NIMCollection> - 本次分页查询返回的收藏列表。

    NIMSendMessageParams

    消息发送参数配置。

    dartNIMSendMessageParams({
    NIMMessageConfig? messageConfig,
    NIMMessageRouteConfig? routeConfig,
    NIMMessagePushConfig? pushConfig,
    NIMMessageAntispamConfig? antispamConfig,
    NIMMessageRobotConfig? robotConfig,
    NIMMessageAIConfigParams? aiConfig,
    bool? clientAntispamEnabled,
    String? clientAntispamReplace,
    })
    
    名称 类型 是否必填 默认值 说明
    messageConfig NIMMessageConfig - 消息相关配置。
    routeConfig NIMMessageRouteConfig - 消息事件抄送相关配置。
    pushConfig NIMMessagePushConfig - 消息第三方推送相关配置。
    第三方推送功能需要在 网易云信控制台配置
    antispamConfig NIMMessageAntispamConfig - 消息反垃圾相关配置,包括本地反垃圾或安全通配置,均需要在 网易云信控制台开通
    robotConfig NIMMessageRobotConfig - 消息机器人相关配置。
    该参数信息需要与控制台机器人配置信息一致。
    clientAntispamEnabled bool false 是否启用本地反垃圾。
  • 仅对文本消息生效
  • 如果开启本地发垃圾,发送消息时会进行本地反垃圾检测,完成后返回检测结果 NIMClientAntispamOperateType
    • 0:检测通过,可以发送该消息。
    • 1:发送替换后的文本消息。
    • 2:检测不通过,消息发送失败,返回本地错误码。
    • 3:消息发送后,由服务端拦截
  • clientAntispamReplace String clientAntispamEnabled 为 true 则必填 "" 反垃圾命中后替换的文本。
    aiConfig NIMMessageAIConfigParams - 数字人请求 LLM 大模型的相关参数。

    NIMMessageTargetConfig

    群定向消息数据结构。

    dartNIMMessageTargetConfig({
    bool inclusive = true,
    bool newMemberVisible = false,
    List<String>? receiverIds,
    })
    
    名称 类型 是否必填 默认值 说明
    inclusive Boolean true 群定向消息成员列表是否为可见列表。默认为 true,即 receiver_account_ids 为可见(接收)列表。receiver_account_ids 之外的成员为不可见列表。若设置为 false,则相反。发送超大群消息时,不能将 inclusive 设置为 false。
    receiverIds List<String> - 群定向消息成员列表,即指定接收群消息的群成员列表。
  • inclusive 为 true,当前列表为可见(接收)列表。
  • inclusive 为 false,当前列表为不可见(不接收)列表。
  • 列表中不能包含消息发送者,消息发送者默认为可见。
  • 列表中不能包含非法账号、非群成员账号,也不能为空。
  • 列表中最多可以传入 100 个用户账号。
  • newMemberVisible Boolean false 新进群成员是否可见该消息。默认为 false,即新进群成员不可以查看该群定向消息。若设置为 true,则新进群成员若可以查询该定向消息,可以通过云端历史相关接口查询到该消息。
  • inclusive 为 true 时,不能同时设置 visible_to_new_member 为 true。即发送定向列表为可见的定向消息时,只能由定向列表中成员接收和查看。
  • 发送超大群消息时,不能将 visible_to_new_member 设置为 true。
  • NIMModifyMessageParams

    消息更新参数配置。

    dartNIMModifyMessageParams({
    NIMMessageAttachment? attachment,
    String? serverExtension,
    NIMMessagePushConfig? pushConfig,
    String? text,
    NIMMessageAntispamConfig? antispamConfig,
    bool clientAntispamEnabled = false,
    String? clientAntispamReplace,
    NIMMessageRouteConfig? routeConfig,
    int? subType,
    })
    
    名称 类型 是否必填 默认值 说明
    subType int/undefined - 自定义消息子类型,0 表示无消息子类型。
    text String - 消息文本内容,仅文本类型的消息有该字段。
    attachment NIMMessageAttachment - 消息附件,仅图片、语音、视频、文件类型消息有该字段。根据消息类型继承实现。
    serverExtension String - 消息服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    routeConfig NIMMessageRouteConfig - 消息事件抄送相关配置。
    pushConfig NIMMessagePushConfig - 消息第三方推送相关配置。
    第三方推送功能需要在 网易云信控制台配置
    antispamConfig NIMMessageAntispamConfig - 消息反垃圾相关配置,包括本地反垃圾或安全通配置,均需要在 网易云信控制台开通
    clientAntispamEnabled bool false 是否启用本地反垃圾。
  • 仅对文本消息生效
  • 如果开启本地发垃圾,发送消息时会进行本地反垃圾检测,完成后返回检测结果 NIMClientAntispamOperateType
    • 0:检测通过,可以发送该消息。
    • 1:发送替换后的文本消息。
    • 2:检测不通过,消息发送失败,返回本地错误码。
    • 3:消息发送后,由服务端拦截
  • clientAntispamReplace String clientAntispamEnabled 为 true 则必填 "" 反垃圾命中后替换的文本。

    NIMModifyMessageResult

    更新消息结果信息。

    DartNIMModifyMessageResult({
    NIMMessage? message,
    String? antispamResult,
    NIMClientAntispamResult? clientAntispamResult,
    int? errorCode,
    })
    
    名称 类型 是否只读 说明
    message NIMMessage 更新成功后的消息对象。
    antispamResult String 安全通反垃圾检测结果。
    clientAntispamResult NIMClientAntispamResult 客户端本地反垃圾结果。
    errorCode int 默认为 200。如果此错误码为非 200,表示修改消息失败(例如触发云端反垃圾),此时修改成功后的消息体返回为 null。

    NIMUpdateLocalMessageParams

    本地插入消息更新的配置参数。

    dartNIMUpdateLocalMessageParams({
    int? subType,
    String? text,
    NIMMessageAttachment? attachment,
    String? localExtension,
    NIMMessageSendingState? sendingState,
    })
    
    名称 类型 是否必填 说明
    subType int 自定义消息子类型,0 表示无消息子类型。
    text String 消息文本内容,仅文本类型的消息有该字段。
    attachment NIMMessageAttachment 消息附件,仅图片、语音、视频、文件类型消息有该字段。根据消息类型继承实现。
    localExtension String 消息本地扩展字段。
    sendingState NIMMessageSendingState 消息发送状态。仅支持发送成功和发送错误两种状态,其他状态返回参数报错。

    NIMMessageRefer

    消息参考信息对象。

    dartNIMMessageRefer({
    String? senderId,
    String? receiverId,
    String? messageClientId,
    String? messageServerId,
    NIMConversationType? conversationType,
    String? conversationId,
    int? createTime,
    })
    
    名称 类型 是否只读 说明
    senderId String 消息发送方账号(accountId)。
    receiverId String 消息接收方账号
  • 如果消息所属会话类型为单聊,该字段为聊天对象账号。
  • 如果消息所属会话类型为群组,该字段为群组 ID。
  • messageClientId String 客户端消息 ID,不多端同步。
    messageServerId String 服务端消息 ID,多端同步。
    conversationType NIMConversationType 会话类型。
    conversationId String 会话 ID
    createTime int 消息时间戳,单位毫秒。

    NIMMessageAttachment

    消息附件对象。

    dartNIMMessageAttachment({
      String? raw,
    })
    
    名称 类型 是否必填 默认值 说明
    raw String - 消息附件,建议为 JSON 格式。

    NIMDownloadMessageAttachmentParams

    下载消息附件的请求配置参数。

    dartNIMDownloadMessageAttachmentParams({
    required NIMMessageAttachment attachment,
    required NIMDownloadAttachmentType type,
    required NIMSize thumbSize,
    String? messageClientId,
    String? saveAs,
    })
    
    名称 类型 是否必填 默认值 说明
    attachment NIMMessageAttachment - 需要下载的附件。
    type NIMDownloadAttachmentType nimDownloadAttachmentTypeSource(原始文件) 下载附件的类型。包括原始文件、缩略图、视频封面。
    thumbSize NIMSize {150,0}
    内置默认值,不是在声明时指定的,而是运行时根据用户情况判断
    若下载的是缩略图或者视频封面,通过该参数指定缩略图大小或视频封面大小。
    messageClientId String - 若指定该参数并且下载的是原始文件,则 SDK 会将下载完成后的本地附件保存路径更新到消息数据库中,下一次查询时将直接返回对应的路径。
    saveAs String - 附件保存路径,如未指定 SDK 将下载到登录用户缓存目录,如指定该参数则以指定的路径为准。

    NIMGetMediaResourceInfoResult

    下载消息附件的返回结果。

    dartNIMGetMediaResourceInfoResult({
    String? url,
    Map<String, String>? authHeaders,
    })
    
    名称 类型 是否必填 是否只读 说明
    url String 附件资源完整下载地址。
    authHeaders Map<String, String> 下载该资源所需的鉴权信息,当列表为空时则代表不需要鉴权,若不为空则需要将该列表添加到请求时的 Header 中。

    NIMSize

    二维平面大小。

    dartNIMSize({
    int? width,
    int? height,
    })
    
    名称 类型 是否必填 默认值 说明
    width int 0 二维平面宽度。
    height int 0 二维平面高度。

    NIMMessageFileAttachment

    文件类型消息的附件对象,继承自 NIMMessageAttachment

    dartNIMMessageFileAttachment({
    String? path,
    int? size,
    String? md5,
    String? url,
    String? ext,
    String? name,
    String? sceneName,
    NIMMessageAttachmentUploadState? uploadState,
    })
    
    名称 类型 是否必填 默认值 说明
    path String 除 Web 端外,其他端均为必填。 - 附件本地路径。
    请确保该路径存在且可用,SDK 会根据该字段判断附件是否存在。
    size int - 文件大小。
    md5 String - 文件内容 MD5 值。
    url String - - 文件服务器路径。
    ext String null 文件扩展名,例如:.png.txt 等。
    name String - 文件显示名。包含扩展名,例如:1.png2.txt 等。
    sceneName String - - 网易对象存储 NOS 文件存储场景名。若使用自定义的存储场景,需要先调用 NIMStorageService.addCustomStorageScene 添加自定义存储场景。
    uploadState NIMMessageAttachmentUploadState - - 消息附件上传状态。

    NIMMessageImageAttachment

    图片附件对象,继承自 NIMMessageFileAttachment

    dartNIMMessageImageAttachment({
    int? width,
    int? height,
    })
    
    名称 类型 是否必填 默认值 说明
    width int - 图片宽度,单位像素。
    height int - 图片高度,单位像素。

    NIMMessageAudioAttachment

    语音附件对象,继承自 NIMMessageFileAttachment

    dartNIMMessageAudioAttachment({
    int? duration,
    })
    
    名称 类型 是否必填 默认值 说明
    duration int - 语音文件时长,单位为毫秒。

    NIMMessageVideoAttachment

    视频附件对象,继承自 NIMMessageFileAttachment

    dartNIMMessageVideoAttachment({
    int? duration,
    int? width,
    int? height,
    })
    
    名称 类型 是否必填 默认值 说明
    duration int - 视频文件时长,单位为毫秒。
    width int - 视频宽度,单位像素。
    height int - 视频高度,单位像素。

    NIMMessageCallAttachment

    话单消息附件对象,继承自 NIMMessageAttachment

    dartNIMMessageCallAttachment({
    int? type,
    String? channelId,
    int? status,
    List<NIMMessageCallDuration?>? durations,
    })
    
    名称 类型 是否必填 默认值 说明
    type int - 话单类型,业务侧可自定义,网易云信不校验内容。建议设置为:
  • 1:音频
  • 2:视频
  • channelId String - 话单频道 ID,网易云信不校验内容。
    status int - 通话状态,业务侧可自定义状态,网易云信不校验内容。建议设置为:
  • 1:通话完成
  • 2:通话取消
  • 3:通话拒绝
  • 4:超时未接听
  • 5:对方忙
  • duration List<NIMMessageCallDuration> - 通话成员时长列表,网易云信不校验内容。

    NIMMessageCallDuration

    话单消息单人通话时长对象。

    dartNIMMessageCallDuration({
      String? accountId,
      int? duration,
    })
    
    名称 类型 是否必填 默认值 说明
    accountId String - 话单对应成员的账号 ID。
    duration int - 通话时长。

    NIMMessageLocationAttachment

    地理位置附件对象,继承自 NIMMessageAttachment

    dartNIMMessageLocationAttachment({
    double? longitude,
    double? latitude,
    String? address,
    })
    
    名称 类型 是否必填 默认值 说明
    latitude double - 地理位置纬度。
    longitude double - 地理位置经度。
    address String - 地理位置描述。

    NIMMessageNotificationAttachment

    通知附件对象,继承自 NIMMessageAttachment

    dartNIMMessageNotificationAttachment({
    NIMMessageNotificationType? type,
    String? serverExtension,
    List<String?>? targetIds,
    bool? chatBanned,
    NIMUpdatedTeamInfo? updatedTeamInfo,
    })
    
    名称 类型 是否必填 默认值 说明
    type NIMMessageNotificationType - 通知类型。
    serverExtension String null 服务端扩展字段。必须为 JSON 格式封装,多端同步。
    targetIds List<String> null 被操作者用户账号(accountId)列表。
    chatBanned bool null 群成员是否被禁言。
    updatedTeamInfo NIMUpdatedTeamInfo null 群信息更新字段。
    如有字段信息,则表示对应字段被修改。

    NIMSendMessageResult

    消息发送成功结果回包。

    dartNIMSendMessageResult({
    NIMMessage? message,
    String? antispamResult,
    NIMClientAntispamResult? clientAntispamResult,
    })
    
    名称 类型 是否只读 说明
    message NIMMessage 更新成功后的消息对象。
    antispamResult String 安全通反垃圾检测结果。
    clientAntispamResult NIMClientAntispamResult 客户端本地反垃圾结果。

    NIMMessageListOption

    消息分页查询选项。

    dartNIMMessageListOption({
    String? conversationId,
    List<int>? messageTypes,
    int? beginTime,
    int? endTime,
    int? limit,
    NIMMessage? anchorMessage,
    NIMQueryDirection? direction,
    bool? strictMode,
    bool onlyQueryLocal = false,
    })
    
    名称 类型 是否必填 默认值 说明
    conversationId String - 消息所属的会话 ID,通过调用 ConversationIdUtil 的对应函数创建。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    messageTypes List<int> null 消息类型,为 null 或空列表则表示查询所有消息类型。
    beginTime int 0 查询开始时间,该字段必须小于等于 endTime
    endTime int 0 查询结束时间,字段必须大于等于 beginTime,默认为系统当前时间。
    limit int 50 本次查询条数上限,取值范围为 [0,100]。传入小于 0 则默认为 50。
    anchorMessage NIMMessage - 查询的消息锚点。查询结果不包含该锚点消息。
  • 该字段为空,则以 [beginTime,endTime] 为查询范围。
  • 该字段不为空:
    • directionDESC,如果 endTime 为 0,则以 anchorMessage 对应的时间戳为准。如果 endTime 不为 0,则必须与 anchorMessage 时间相同,否则返回 191004 参数错误。
    • directionASC,如果 beginTime 为 0,则以 anchorMessage 的时间戳为准。如果 beiginTime 不为 0,则必须与 anchorMessage 时间相同,否则返回 191004 参数错误。
  • direction NIMQueryDirection desc 查询方向:按照时间升序或降序。
    strictmode bool false 严格模式.
  • true:如果无法确定消息完整性,则查询失败返回错误码,错误码由失败原因决定。
  • false:如果无法确定消息完整性,则从本地数据库中查询。
  • onlyQueryLocal bool false 是否只查询本地数据。
  • true:只查询本地数据。
  • false(默认):结合其他参数综合判断消息来源进行查询。
  • NIMMessageListResult

    查询消息列表结果。

    dartNIMMessageListResult({
    List<NIMMessage>? messages,
    NIMMessage? anchorMessage,
    })
    
    名称 类型 是否必填 默认值 说明
    messages List<NIMMessage> - 查询到的消息列表。
    anchorMessage NIMMessage - 下次查询的锚点消息。

    NIMThreadMessageListOption

    Thread 消息分页查询选项。

    dartNIMThreadMessageListOption({
    NIMMessageRefer? messageRefer,
    int? beginTime,
    int? endTime,
    String? excludeMessageServerId,
    int? limit,
    NIMQueryDirection? direction,
    })
    
    名称 类型 是否必填 默认值 说明
    messageRefer NIMMessageRefer> - Thread 消息参考信息,支持根据 Thread 根消息的参考信息查询本地子消息。
    beginTime int 0 查询开始时间,该字段必须小于等于 endTime
    endTime int 0 查询结束时间,字段必须大于等于 beginTime,默认为系统当前时间。
    limit int 50 本次查询条数上限,取值范围为 [0,100]。传入小于 0 则默认为 50。
    excludeMessageServerId String - 锚点消息的 ServerId。该消息必须处于端点,即消息时间必须等于 beginTimeendTime。如果是合法的消息 ID 则表示排除该消息,否则不排除。
    direction NIMQueryDirection desc 消息查询方向:按照时间升序(ASC)或降序(DESC)。

    NIMThreadMessageListResult

    Thread 消息查询结果。

    dartNIMThreadMessageListResult({
    NIMMessage? message,
    int? timestamp,
    int? replyCount,
    List<NIMMessage?>? replyList,
    })
    
    名称 类型 是否只读 默认值 说明
    message NIMMessage - Thread 消息根消息。
    timestamp int - 获取 Thread 消息中最后一条消息的时间戳。
    replyCount int - 获取 Thread 消息中的总回复数,Thread 消息不计入总数。
    replyList List<NIMMessage> - 消息回复列表。

    NIMP2PMessageReadReceipt

    单聊消息已读回执对象。

    dartNIMP2PMessageReadReceipt({
    String? conversationId,
    int? timestamp,
    })
    
    名称 类型 是否只读 说明
    conversationId String 消息所属的会话 ID,通过调用 ConversationIdUtil 的对应函数创建。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    timestamp int 最后一条已读消息的时间戳,早于该消息都判定为已读消息。

    NIMTeamMessageReadReceipt

    群组消息已读回执对象。

    dartNIMTeamMessageReadReceipt({
    String? conversationId,
    String? messageServerId,
    String? messageClientId,
    int? readCount,
    int? unreadCount,
    String? latestReadAccount,
    })
    
    名称 类型 是否只读 说明
    conversationId String 消息所属的会话 ID,通过调用 ConversationIdUtil 的对应函数创建。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    messageServerId String 已读的服务端消息 ID。
    messageClientId String 已读的客户端消息 ID。
    readCount int 该群组消息已读人数。
    unreadCount int 该群组消息未读人数。
    latestReadAccount String 该群消息最新已读账号(accountId)。

    NIMTeamMessageReadReceiptDetail

    群组消息已读回执详情。

    dartNIMTeamMessageReadReceiptDetail({
    NIMTeamMessageReadReceipt? readReceipt,
    List<String?>? readAccountList,
    List<String?>? unreadAccountList,
    })
    
    名称 类型 是否只读 说明
    readReceipt NIMTeamMessageReadReceipt 群组消息已读回执对象。
    readAccountList List<String> 群组消息已读账号列表。
    unreadAccountList List<String> 群组消息未读账号列表。

    NIMMessageRevokeParams

    消息撤回配置参数。

    dartNIMMessageRevokeParams({
    String? postscript,
    String? serverExtension,
    String? pushContent,
    String? pushPayload,
    String? env,
    })
    
    名称 类型 是否必填 默认值 说明
    postscript String null 附言。
    serverExtension String null 服务端扩展字段。必须为 JSON 格式封装,多端同步,长度上限为 1024 字节。
    pushContent String null 推送文案。
    pushPayload String null 推送 Payload
    env String null 消息抄送地址,必须与网易云信控制台 开通配置 的消息抄送地址一致。

    NIMMessageRevokeNotification

    消息撤回通知。

    dartNIMMessageRevokeNotification({
    NIMMessageRefer? messageRefer,
    String? serverExtension,
    String? revokeAccountId,
    String? postscript,
    NIMMessageRevokeType? revokeType,
    String? callbackExtension,
    })
    
    名称 类型 是否只读 说明
    messageRefer NIMMessageRefer 撤回消息的参考信息。
    serverExtension String 服务端扩展字段,多端同步。
    revokeAccountId String 推送文案。
    postscript String 附言。
    revokeType NIMMessageRevokeType 消息撤回类型。
    callbackExtension String 第三方回调透传的自定义扩展字段。
    第三方回调功能需要在 网易云信控制台开通

    NIMMessageDeletedNotification

    消息删除通知。

    dartNIMMessageDeletedNotification({
    NIMMessageRefer? messageRefer,
    int? deleteTime,
    String? serverExtension,
    })
    
    名称 类型 是否只读 说明
    messageRefer NIMMessageRefer 被删除消息的参考信息。
    deleteTime int 删除时间戳。
    serverExtension String 删除时传入的服务端扩展字段,多端同步。

    NIMMessageQuickCommentNotification

    消息快捷评论操作通知。

    dartNIMMessageQuickCommentNotification({
    NIMMessageQuickCommentType? operationType,
    NIMMessageQuickComment? quickComment,
    })
    
    名称 类型 是否只读 说明
    operationType NIMMessageQuickCommentType 快捷评论操作类型。
    quickComment NIMMessageQuickComment 消息快捷评论信息。

    NIMMessagePinNotification

    Pin 消息通知。

    dartNIMMessagePinNotification({
    NIMMessagePin? pin,
    NIMMessagePinState? pinState,
    })
    
    名称 类型 是否只读 说明
    pinState NIMMessagePinState Pin 消息状态。
    pin NIMMessagePin Pin 消息信息。

    NIMClearHistoryMessageOption

    历史消息清空选项。

    dartNIMClearHistoryMessageOption({
    String? conversationId,
    bool? deleteRoam,
    bool? onlineSync,
    String? serverExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    conversationId String - 历史消息所属的会话 ID,通过调用 ConversationIdUtil 的对应函数创建。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    deleteRoam bool true 是否同步删除漫游消息:
  • true:删除漫游消息
  • false:保留漫游消息。
  • onlineSync bool false 是否多端同步。
    serverExtension String null 服务端扩展字段。必须为 JSON 格式封装,多端同步。

    NIMClearHistoryNotification

    会话历史消息清空通知。

    dartNIMClearHistoryNotification({
    String? conversationId,
    double? deleteTime,
    String? serverExtension,
    })
    
    名称 类型 是否只读 说明
    conversationId String 会话 ID。
    deleteTime double 清空的时间戳。
    serverExtension String 清空时传入的服务端扩展字段,多端同步。

    NIMSendMessageProgress

    消息发送进度。

    dartNIMSendMessageProgress({
    String? messageClientId,
    int? progress,
    })
    
    名称 类型 是否只读 说明
    messageClientId String 消息客户端 ID。
    progress int 消息发送进度。

    NIMMessageSearchParams

    历史消息全文检索查询参数。

    超大群不支持历史消息全文检索功能。

    dartNIMMessageSearchParams({
    String? keyword,
    int? beginTime,
    int? endTime,
    int? conversationLimit,
    int? messageLimit,
    NIMSortOrder? sortOrder,
    List<String?>? p2pAccountIds,
    List<String?>? teamIds,
    List<String?>? senderAccountIds,
    List<int>? messageTypes,
    List? messageSubtypes,
    })
    
    名称 类型 是否必填 默认值 说明
    keyword String - 检索关键字。
    beginTime int 0 查询开始时间。该字段必须小于等于 endTime
    endTime int 0,即系统当前时间。 查询结束时间。该字段必须大于等于 beginTime
    conversationLimit int 0 本次检索的会话条数上限:
  • 设置为大于 0:查询结果按照会话分组显示。
  • 设置为小于或等于 0:查询结果按照时间排序。
  • messageLimit int 10 本次检索返回的消息条数上限,0 表示无限制。
    sortOrder NIMSortOrder sortOrderDesc 检索结果的排序规则,按照消息时间戳升序或降序排序。
    p2pAccountIds List<String> null 单聊账号列表。最多传入 20 个账号,否则返回 191004 参数错误。
    teamIds List<String> null 高级群账号列表。最多传入 20 个账号,否则返回 191004 参数错误。
    senderAccountIds List<String> null 发送方账号列表。最多传入 20 个账号,否则返回 191004 参数错误。
    messageTypes List<int> null 或空,即查询所有消息类型。 消息类型。
    messageSubtypes List null 或空,即查询所有消息子类型。 自定义消息子类型。

    NIMMessageSearchExParams

    历史消息全文检索查询参数。

    dartNIMMessageSearchExParams({
    String? pageToken,
    String? conversationId,
    List<String>? keywordList,
    NIMSearchKeywordMatchType? keywordMatchType,
    List<String>? senderAccountIds,
    List<NIMMessageType>? messageTypes,
    List<int>? messageSubtypes,
    int? searchStartTime,
    int? searchTimePeriod,
    int? limit,
    NIMSearchDirection? direction,
    NIMSearchStrategy? strategy,
    })
    
    名称 类型 是否必填 默认值 说明
    pageToken String - 搜索的起始位置。第一次填传入空字符串,后续填写上一次返回结果中的 nextPageToken
    conversationId String - 若为空,则搜索全部会话;若不为空,则搜索传入的指定会话。
    keywordList List<String> - 检索关键字列表,最多支持 5 个。当消息发送者以及消息类型均未指定时,必须设置关键字列表;否则,关键字列表可以为空。
    keywordMatchType NIMMessageType V2NIM_SEARCH_KEYWORD_MATH_TYPE_OR 指定关键字列表匹配类型。
    可设置为 “或” 关系(V2NIM_SEARCH_KEYWORD_MATH_TYPE_OR,默认)搜索,或 “与” 关系(V2NIM_SEARCH_KEYWORD_MATH_TYPE_AND)搜索。
    关键字列表为空或为数量为 1,该字段无效。
    senderAccountIds List<String> - 发送方账号列表。最多传入 5 个账号,否则返回 191004 参数错误。
    messageTypes List<NIMMessageType> - 根据消息类型检索消息,为 null 或空列表,则表示查询所有消息类型。
    关键字不为空时,不支持检索通知类消息。
    非文本消息,只检索对应检索字段,如果检索字段为空则该消息不会被检索到。
    messageSubtypes List<int> - 自定义消息子类型列表,0 代表无消息子类型。
    searchStartTime int 0 查询开始时间,UTC 时间戳,单位:毫秒。该字段必须小于等于 searchTimePeriod
    searchTimePeriod int 0 从起始时间点开始的过去时间范围,UTC 时间戳,单位:毫秒。该字段必须大于等于 searchStartTime
    limit int 20 本次检索返回的消息条数上限,最大为 100。
    direction NIMSearchDirection - 检索方向。
    strategy NIMSearchStrategy - 消息检索的策略。

    NIMMessageSearchResult

    历史消息全文检索查询结果。

    dartNIMMessageSearchResult({
    int? count,
    List<NIMMessageSearchItem>? items,
    String? nextPageToken,
    bool hasMore = false,
    })
    
    名称 类型 是否必填 默认值 说明
    count int - 满足检索条件的所有消息数量。
    items List<NIMMessageSearchItem> -
    • 单个会话的返回结果:
      • 如果查询会话 ID 不会空,则返回的 items 会对应按指定条数检索出来的会话消息。
      • 如果会话 ID 为空,则为每一个会话检索出来的内容。
      • 单个 items 查询的消息按从新到旧排序。
    • 多个会话的返回结果:
      按每个会话的最新消息从新到旧排序。
    nextPageToken String - 下一次查询的分页 Token。

    NIMMessageSearchItem

    消息检索单条会话的返回结果。

    dartNIMMessageSearchItem({
    required String conversationId,
    List<NIMMessage>? messages,
    required int count,
    })
    
    名称 类型 是否只读 说明
    messages List<NIMMessage> 返回的消息列表。
    conversationId String 查询的会话 ID。
    count int 单个会话的返回消息数量。

    NIMClientAntispamResult

    文本消息客户端本地反垃圾结果。

    dartNIMClientAntispamResult({
    NIMClientAntispamOperateType? operateType,
    String? replacedText,
    })
    
    名称 类型 是否只读 说明
    operateType NIMClientAntispamOperateType 反垃圾命中后的操作类型。
    replacedText String 替换处理后的文本内容。

    NIMVoiceToTextParams

    语音转文字配置参数。

    dartNIMVoiceToTextParams({
    String? voicePath,
    String? voiceUrl,
    String? mimeType,
    String? sampleRate,
    int? duration,
    String? sceneName,
    })
    
    名称 类型 是否必填 默认值 说明
    voicePath String voiceUrl 必须设置其一 - 语音文件本地路径。
    请确保该路径存在且可用。
    voiceUrl String voicePath 必须设置其一 - 语音文件 URL 地址。
    mimeType String null 音频类型,例如 aac, wav, mp3, amr 等。
    sampleRate String null 音频采样率,单位为 kHz。
    duration int - 语音文件时长,单位为毫秒。
    sceneName String - 网易对象存储 NOS 文件存储场景名。若使用自定义的存储场景,需要先调用 StorageService.addCustomStorageScene 添加自定义存储场景。

    NIMStorageScene

    网易对象存储 NOS 文件存储场景信息。

    dartNIMStorageScene({
    String? sceneName,
    int? expireTime,
    })
    
    名称 类型 是否只读 说明
    sceneName String 网易对象存储 NOS 文件存储场景名称。
    expireTime int 该场景下文件资源的过期时间,单位秒。必须大于等于 0,0 表示永不过期。

    NIMCustomNotification

    自定义通知。

    dartNIMCustomNotification({
    String? senderId,
    String? receiverId,
    NIMConversationType? conversationType,
    required int timestamp,
    String? content,
    NIMNotificationConfig? notificationConfig,
    NIMNotificationPushConfig? pushConfig,
    NIMNotificationAntispamConfig? antispamConfig,
    NIMNotificationRouteConfig? routeConfig,
    })
    
    名称 类型 是否只读 说明
    senderId String 自定义通知发送方账号(accountId)
    receiverId String 自定义通知发送方账号(accountId)
  • 如果会话类型为单聊,该字段为聊天对象账号 accountId。
  • 如果会话类型为群组,该字段为群组 ID。
  • conversationType NIMConversationType 消息所属会话类型:单聊/高级群/超大群。
    timestamp int 自定义通知时间戳。
    content String 自定义通知内容,必须封装为 JSON 格式,长度上限为 4096 字节。
    notificationConfig NIMNotificationConfig 通知相关配置。
    pushConfig NIMNotificationPushConfig 第三方推送相关配置。
    第三方推送功能需要在 网易云信控制台配置
    antispamConfig NIMNotificationAntispamConfig 反垃圾相关配置。
    反垃圾功能包括客户端反垃圾和安全通,均需要在 网易云信控制台开通
    routeConfig NIMNotificationRouteConfig 系统通知事件抄送相关配置。
    消息抄送功能需要在 网易云信控制台开通

    NIMNotificationConfig

    系统通知相关配置。

    dartNIMNotificationConfig({
    bool? offlineEnabled,
    bool? unreadEnabled,
    })
    
    名称 类型 是否必填 默认值 说明
    offlineEnabled bool true 是否需要保存离线通知:
  • true:需要保存。
  • false:不需要保存,仅在线用户接收通知。
  • unreadEnabled bool true 是否需要计入通知未读数。

    NIMNotificationPushConfig

    系统通知第三方推送相关配置。

    dartNIMNotificationPushConfig({
    bool? pushEnabled,
    bool? pushNickEnabled,
    String? pushContent,
    String? pushPayload,
    bool? forcePush,
    String? forcePushContent,
    List<String>? forcePushAccountIds,
    })
    
    名称 类型 是否必填 默认值 说明
    pushEnabled bool true 是否需要推送通知。
    pushNickEnabled bool true 是否需要推送通知发送方昵称。
    pushContent String 云信内置的推送文案 推送文案。
    pushPayload String - 推送 Payload
    forcePush bool false 是否忽略用户通知提醒相关设置,强制推送。
    forcePushContent String - 强制推送文案。
    forcePushAccountIds List<String> - 强制推送目标账号列表。

    NIMNotificationRouteConfig

    系统通知事件抄送相关配置。

    dartNIMNotificationRouteConfig({
    bool? routeEnabled,
    String? routeEnvironment,
    })
    
    名称 类型 是否必填 默认值 说明
    routeEnabled bool true 是否需要系统通知事件抄送。
    routeEnvironment String routeEnabled 为 true 则为必填 - 环境变量,用于指向不同系统通知事件抄送、第三方回调等配置。

    NIMNotificationAntispamConfig

    系统通知反垃圾配置,包括本地反垃圾和安全通的相关配置。

    dartNIMNotificationAntispamConfig({
    bool? antispamEnabled,
    String? antispamCustomNotification,
    })
    
    名称 类型 是否必填 默认值 说明
    antispamEnabled bool true 是否对该系统通知启用安全通检测。
    antispamCustomNotification String antispamEnabled 为 true 时必填 - 系统通知中需要反垃圾的内容,必须是 JSON 格式,长度不超过 5000 字节。格式如下 { "type": 1, //1:文本,2:图片,3 视频 "data": "" //文本内容 or 图片地址 or 视频地址 }

    NIMSendCustomNotificationParams

    自定义通知发送参数。

    dartNIMSendCustomNotificationParams({
    NIMNotificationConfig? notificationConfig,
    NIMNotificationPushConfig? pushConfig,
    NIMNotificationAntispamConfig? antispamConfig,
    NIMNotificationRouteConfig? routeConfig,
    })
    
    名称 类型 是否只读 说明
    notificationConfig NIMNotificationConfig 通知相关配置。
    pushConfig NIMNotificationPushConfig 第三方推送相关配置。
    第三方推送功能需要在 网易云信控制台配置
    antispamConfig NIMNotificationAntispamConfig 反垃圾相关配置。
    反垃圾功能包括客户端反垃圾和安全通,均需要在 网易云信控制台开通
    routeConfig NIMNotificationRouteConfig 系统通知事件抄送相关配置。
    消息抄送功能需要在 网易云信控制台开通

    NIMBroadcastNotification

    广播通知。

    dartNIMBroadcastNotification({
    required int id,
    String? senderId,
    required int timestamp,
    String? content,
    })
    
    名称 类型 是否只读 说明
    id int 广播通知 ID。
    senderId String 广播通知发送方账号(accountId)。
    timestamp int 广播通知时间戳。
    content String 广播通知内容,必须为 JSON 格式。

    NIMTeam

    群组对象。

    dartNIMTeam({
    required String teamId,
    required NIMTeamType teamType,
    required String name,
    required String ownerAccountId,
    required int memberLimit,
    required int memberCount,
    required int createTime,
    required int updateTime,
    String? intro,
    String? announcement,
    String? avatar,
    String? serverExtension,
    String? customerExtension,
    required NIMTeamJoinMode joinMode,
    required NIMTeamAgreeMode agreeMode,
    required NIMTeamInviteMode inviteMode,
    required NIMTeamUpdateInfoMode updateInfoMode,
    required NIMTeamUpdateExtensionMode updateExtensionMode,
    required NIMTeamChatBannedMode chatBannedMode,
    required bool isValidTeam,
    })
    
    名称 类型 是否只读 默认值 说明
    teamId String - 群组 ID
    teamType NIMTeamType typeNormal 群组类型。
    name String - 群组名称。
    ownerAccountId String - 群主账号。
    memberLimit int - 群组人数上限。必须大于 0,否则返回参数错误。
  • 高级群:默认 200 人/群(免费),可通过 网易云信控制台配置为 500/1000/2000 人/群(计费),最大可扩展至 5000 人/群(联系商务经理或技术支持)。
  • 超大群:默认 2000 人/群,可通过 网易云信控制台 上配置为 2000-10000 人/群。
  • 2000 人以上的群必须由服务端 API 发起创建。
  • memberCount int - 群组当前人数。
    createTime int - 群组创建时间戳。
    updateTime int - 群组更新时间戳。
    intro String - 群组介绍,最大为 255 个字符。
    announcement String - 群组公告,最大为 5000 个字符。
    avatar String - 群组头像。
    serverExtension String - 群组服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    customerExtension String - 客户自定义扩展字段,仅服务器 API 可以设置,SDK 仅负责透传,不解析内容。
    joinMode NIMTeamJoinMode NIMTeamJoinMode.joinModeFree 无需验证 入群验证模式。
    agreeMode NIMTeamAgreeMode NIMTeamAgreeMode.agreeModeAuth 需要被邀请人同意 被邀请人同意模式。
    inviteMode NIMTeamInviteMode NIMTeamInviteMode.inviteModeManager 仅群主或管理员可以邀请其他人入群 群组邀请模式,即群主/管理员或普通成员可以邀请入群。
    updateInfoMode NIMTeamUpdateInfoMode NIMTeamUpdateInfoMode.updateInfoModeManager 仅群主或管理员可以修改群组资料 群组资料修改模式。
    updateExtensionMode NIMTeamUpdateExtensionMode NIMTeamUpdateExtensionMode.updateExtensionModeManager 仅群主或管理员可以修改群组资料 群组扩展字段修改模式。
    chatBannedMode NIMTeamChatBannedMode chatBannedModeNone 不禁言 群组禁言状态。
    isValidTeam bool true 是否为自己所在且有效的群组。

    NIMTeamMember

    群成员对象。

    dartNIMTeamMember({
    required String teamId,
    required NIMTeamType teamType,
    required String accountId,
    required NIMTeamMemberRole memberRole,
    String? teamNick,
    String? serverExtension,
    required int joinTime,
    int? updateTime,
    required bool inTeam,
    bool? chatBanned,
    })
    
    名称 类型 是否必填 是否只读 说明
    teamId String 所属群组 ID
    teamType NIMTeamType 群组类型。
    accountId String 群成员账号。
    memberRole NIMTeamMemberRole 群成员类型。
    teamNick String 群组内昵称。
    serverExtension String 群组服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    joinTime int 加入群组时间戳。
    updateTime int 群成员信息更新时间戳。
    chatBanned bool 是否被禁言。
    inTeam bool 是否在群组中。

    NIMCreateTeamParams

    群组创建配置参数。

    dartNIMCreateTeamParams({
    required String name,
    required NIMTeamType teamType,
    int? memberLimit,
    String? intro,
    String? announcement,
    String? avatar,
    String? serverExtension,
    NIMTeamJoinMode? joinMode,
    NIMTeamAgreeMode? agreeMode,
    NIMTeamInviteMode? inviteMode,
    NIMTeamUpdateInfoMode? updateInfoMode,
    NIMTeamUpdateExtensionMode? updateExtensionMode,
    NIMTeamChatBannedMode? chatBannedMode,
    })
    
    名称 类型 是否必填 默认值 说明
    name String - 群组名称。
    teamType NIMTeamType typeNormal 群组类型。
    必须为高级群或超大群,否则返回参数错误。
    memberLimit int
  • 高级群:200
  • 超大群:2000
  • 群组人数上限。必须大于 0,否则返回参数错误。
  • 高级群:默认 200 人/群(免费),可通过 网易云信控制台配置为 500/1000/2000 人/群(计费),最大可扩展至 5000 人/群(联系商务经理或技术支持)。
  • 超大群:默认 2000 人/群,可通过网易云信控制台 配置为 2000-10000 人/群。
  • 2000 人以上的群必须由服务端 API 发起创建。
  • intro String null 群组介绍,长度上限为 255 个字符。
    announcement String null 群组公告,长度上限为 1024 个字符。最大可扩展至 5000 个字符(提交工单 联系网易云信技术支持工程师申请)。
    avatar String null 群组头像。
    serverExtension String null 群组服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    joinMode NIMTeamJoinMode NIMTeamJoinMode.joinModeFree 无需验证 入群验证模式。
    agreeMode NIMTeamAgreeMode NIMTeamAgreeMode.agreeModeAuth 需要被邀请人同意 被邀请人同意模式。
    inviteMode NIMTeamInviteMode NIMTeamInviteMode.inviteModeManager 仅群主或管理员可以邀请其他人入群 群组邀请模式,即群主/管理员或普通成员可以邀请入群。
    updateInfoMode NIMTeamUpdateInfoMode NIMTeamUpdateInfoMode.updateInfoModeManager 仅群主或管理员可以修改群组资料 群组资料修改模式。
    updateExtensionMode NIMTeamUpdateExtensionMode NIMTeamUpdateExtensionMode.updateExtensionModeManager 仅群主或管理员可以修改群组资料 群组扩展字段修改模式。
    chatBannedMode NIMTeamChatBannedMode NIMTeamChatBannedMode.chatBannedModeNone 不禁言 群组禁言状态。

    NIMTeamMemberQueryOption

    群成员分页查询选项。

    dartNIMTeamMemberQueryOption({
    required NIMTeamMemberRoleQueryType roleQueryType,
    bool? onlyChatBanned,
    NIMQueryDirection? direction,
    String? nextToken,
    int? limit,
    })
    
    名称 类型 是否必填 默认值 说明
    roleQueryType NIMTeamMemberRoleQueryType - 群成员查询类型。
    onlyChatBanned bool false 是否只返回聊天禁言成员列表
  • true:仅聊天禁言成员列表
  • false:全部群成员列表。
  • direction NIMQueryDirection desc 消息查询方向(同时也是查询结果的排序方向):
  • DESC:按时间从大到小(倒序)
  • ASC:按时间从小到大查询(正序)
  • nextToken String "" 分页偏移,首次查询传空,下一次查询传入上一次查询返回值中的 nextToken
    limit int 100 单次查询群成员最大数量。不建议超过 100,设置小于等于 0 则默认为 100。

    NIMUpdateTeamInfoParams

    群组信息更新参数。

    dartNIMUpdateTeamInfoParams({
    String? name,
    int? memberLimit,
    String? intro,
    String? announcement,
    String? avatar,
    String? serverExtension,
    NIMTeamJoinMode? joinMode,
    NIMTeamAgreeMode? agreeMode,
    NIMTeamInviteMode? inviteMode,
    NIMTeamUpdateInfoMode? updateInfoMode,
    NIMTeamUpdateExtensionMode? updateExtensionMode,
    })
    
    • 如果您的应用平台为 Android,则需要调用对应的成员函数获取对应参数。
    • 若参数均未传入,则返回参数错误。
    名称 类型 是否必填 默认值 说明
    name String null 群组名称。
    设置为 null,表示不修改该字段。设置为 "",则返回参数错误。
    memberLimit int
  • 高级群:200
  • 超大群:2000
  • 群组人数上限。
    必须大于 0,否则返回参数错误。设置为 null,表示不修改该字段。
    intro String null 群组介绍,长度上限为 255 个字符。
    设置为 null,表示不修改该字段。
    announcement String null 群组公告,长度上限为 1024 个字符。最大可扩展至 5000 个字符(提交工单 联系网易云信技术支持工程师申请)。
    设置为 null,表示不修改该字段。
    avatar String null 群组头像。
    设置为 null,表示不修改该字段。
    serverExtension String null 群组服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    设置为 null,表示不修改该字段。
    joinMode NIMTeamJoinMode NIMTeamJoinMode.joinModeFree 无需验证 入群验证模式。
    agreeMode NIMTeamAgreeMode NIMTeamAgreeMode.agreeModeAuth 需要被邀请人同意 被邀请人同意模式。
    inviteMode NIMTeamInviteMode NIMTeamInviteMode.inviteModeManager 仅群主或管理员可以邀请其他人入群 群组邀请模式,即群主/管理员或普通成员可以邀请入群。
    updateInfoMode NIMTeamUpdateInfoMode NIMTeamUpdateInfoMode.updateInfoModeManager 仅群主或管理员可以修改群组资料 群组资料修改模式。
    updateExtensionMode NIMTeamUpdateExtensionMode NIMTeamUpdateExtensionMode.updateExtensionModeManager 仅群主或管理员可以修改群组资料 群组扩展字段修改模式。

    NIMCreateTeamResult

    创建群组返回结果。

    dartNIMCreateTeamResult({
    NIMTeam? team,
    List<String>? failedList,
    })
    
    名称 类型 是否只读 说明
    team NIMTeam 已创建的群组对象。
    failedList List<String> 被邀请入群失败的成员列表。

    NIMTeamInviteParams

    邀请成员入群的配置参数。

    dartNIMTeamInviteParams({
    required List<String> inviteeAccountIds,
    String? postscript,
    String? serverExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    inviteeAccountIds List<String> - 被邀请入群的成员账号列表。该字段为 null 返回参数错误。
    postscript String null 邀请入群的附言。
    serverExtension String null 邀请入群的扩展字段。必须为 JSON 格式封装,长度上限为 512 字节,多端同步。
    设置为 null,表示不修改该字段。该字段目前仅支持高级群,不支持超大群。

    NIMUpdateSelfMemberInfoParams

    修改本人群成员信息参数。

    dartNIMUpdateSelfMemberInfoParams({
    String? teamNick,
    String? serverExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    teamNick String null 群组内昵称。
    设置为 null,表示不修改该字段。
    serverExtension String null 群成员服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    设置为 null,表示不修改该字段。

    NIMTeamMemberListResult

    分页获取群成员列表返回结果。

    dartNIMTeamMemberListResult({
    required bool finished,
    String? nextToken,
    List<NIMTeamMember>? memberList,
    })
    
    名称 类型 是否只读 说明
    nextToken String 分页偏移。
    finished bool 群成员是否全部获取:
  • true:已全部获取
  • false:未全部获取,可以继续获取。
  • memberList List<NIMTeamMember> 分页获取的群成员列表。

    NIMTeamJoinActionInfo

    入群操作信息。

    dartNIMTeamJoinActionInfo({
    required NIMTeamJoinActionType actionType,
    required String teamId,
    required NIMTeamType teamType,
    String? operatorAccountId,
    String? postscript,
    int? timestamp,
    required NIMTeamJoinActionStatus actionStatus,
    String? serverExtension,
    })
    
    名称 类型 是否只读 说明
    actionType NIMTeamJoinActionType 入群操作类型。
    teamId String 群组 ID
    teamType NIMTeamType 群组类型。
    operatorAccountId String 入群操作者账号。
    postscript String 操作附言。
    timestamp int 操作时间戳。
    actionStatus NIMTeamJoinActionStatus 操作处理状态。
    serverExtension String 邀请入群的扩展字段,长度上限 512 字符。

    NIMTeamJoinActionInfoQueryOption

    入群操作信息分页查询选项。

    dartNIMTeamJoinActionInfoQueryOption({
    List<int>? types,
    int? offset,
    int? limit = 50,
    List<int>? status,
    })
    
    名称 类型 是否必填 默认值 说明
    types List<int> - 入群操作类型列表。如果列表为空或 size 为 0 则表示查询所有入群操作类型。
    offset int - 分页查询偏移。
    首次查询传 0,下一次查询传入上一次查询返回值中的 offset
    limit int 50 单次查询最大数量。
    status List<int> - 入群操作处理状态类型列表。如果列表为空或 size 为 0 则表示查询所有入群操作处理状态类型。

    NIMTeamJoinActionInfoResult

    入群操作信息分页查询结果。

    dartNIMTeamJoinActionInfoResult({
    List<NIMTeamJoinActionInfo>? infos,
    required int offset,
    required bool finished,
    })
    
    名称 类型 是否只读 说明
    infos List<NIMTeamJoinActionInfo> 入群操作信息列表。
    offset int 分页查询偏移。
    下一次查询传入上一次查询返回值中的 offset
    finished bool 数据是否全部获取:
  • true:已全部获取
  • false:未全部获取,可以继续获取。
  • NIMTeamMemberSearchOption

    根据关键字搜索群成员信息的配置参数。

    dartNIMTeamMemberSearchOption({
    required String keyword,
    required NIMTeamType teamType,
    String? teamId,
    required String nextToken,
    NIMSortOrder? order,
    int? limit,
    })
    
    名称 类型 是否必填 默认值 说明
    keyword String - 搜索关键字,默认搜索群成员的昵称。
    teamType NIMTeamType - 群组类型。
    teamId String null 群组 ID,如果不传则检索所有群,如果需要检索特定的群,则需要同时传入 teamId+teamType
    nextToken String "" 搜索起始位置,首次传 "",后续传上一次返回的 nextToken
    order NIMSortOrder 0 sortOrderDesc:按 joinTime 降序。sortOrderAsc:按 joinTime 升序
    limit int 10 单次查询返回的成员数量,须为正数。

    NIMTeamMemberSearchResult

    根据关键字搜索群成员信息的搜索结果。

    dartNIMTeamMemberSearchResult({
    List<NIMTeamMember>? teamMemberList,
    required String pageToken,
    required bool finished,
    })
    
    名称 类型 是否必填 默认值 说明
    teamMemberList List<NIMTeamMember> - 搜索的群成员列表。
    pageToken String - 分页标识,下次搜索的偏移量。当 finished = true 时,nextToken 设为 ""
    finished bool - 搜索是否结束。

    NIMDndConfig

    推送全局免打扰配置信息。

    dartNIMDndConfig({
    bool? showDetail,
    bool? dndOn,
    int? fromH,
    int? fromM,
    int? toH,
    int? toM,
    })
    
    名称 类型 是否必填 默认值 说明
    showDetail bool false 是否显示推送详情。
    dndOn bool false APNs 推送全局免打扰是否开启。
    fromH int 如果 dndOntrue(开启免打扰)则必填 - 免打扰开始时间(小时数)
    fromM int 如果 dndOntrue(开启免打扰)则必填 - 免打扰开始时间(分钟数)
    toH int 如果 dndOntrue(开启免打扰)则必填 - 免打扰结束时间(小时数)
    toM int 如果 dndOntrue(开启免打扰)则必填 - 免打扰结束时间(分钟数)

    NIMUserInfo

    用户资料对象。

    dartNIMUserInfo({
    String? accountId,
    String? name,
    String? avatar,
    String? sign,
    int? gender,
    String? email,
    String? birthday,
    String? mobile,
    String? serverExtension,
    int? createTime,
    int? updateTime,
    })
    
    名称 类型 是否必填 默认值 说明
    accountId String - 用户账号 ID
    name String - 用户昵称,长度上限 64 字符。
    avatar String "" 用户头像的 URL 地址,例如 "https://netease/xxx.png",长度上限 1024 字符,可设置为空字符串。
    sign String "" 用户签名,长度上限 256 字符,可设置为空字符串。
    email String "" 用户邮箱地址,需符合邮箱字符规则,例如 "zhangsan@xx.com",长度上限 64 字符,可设置为空字符串。
    birthday String "" 用户生日,例如 "xxxx-xx-xx",长度上限 16 字符,可设置为空字符串。
    mobile String "" 用户手机号,长度上限 32 字符,可设置为空字符串
    非中国大陆手机号码需要填写国家代码(如美国:+1-xxxxxxxxxx)或地区代码(如香港:+852-xxxxxxxx)
    gender int 0 用户性别,0:未知。1:男。2:女。
    serverExtension String - 用户资料扩展字段,建议使用 JSON 格式,长度上限为 1024 字符。
    createTime int - 用户资料创建时间。
    updateTime int 0 用户资料更新时间。

    NIMAIUser

    数字人配置的 LLM(Large Language Models)模型类型及相关配置。

    dartNIMAIUser({
    NIMAIModelType? modelType,
    NIMAIModelConfig? modelConfig,
    String? accountId,
    String? name,
    String? avatar,
    String? sign,
    int? gender,
    String? email,
    String? birthday,
    String? mobile,
    String? serverExtension,
    int? createTime,
    int? updateTime,
    })
    

    除以下参数外,NIMAIUser 还继承了 NIMUserInfo 的成员参数。

    名称 类型 是否必填 默认值 说明
    modelType NIMAIModelType - 数字人配置的 LLM(Large Language Models)模型类型:
  • 1:表示阿里云通义千问。
  • 2:表示微软 Azure OpenAI。
  • 3:网易云信定制私有化本地大模型。
  • modelConfig NIMAIModelConfig - 模型相关配置信息,参考 模型可配置字段
    accountId String - 用户账号 ID
    name String - 用户昵称,长度上限 64 字符。
    avatar String "" 用户头像的 URL 地址,例如 "https://netease/xxx.png",长度上限 1024 字符,可设置为空字符串。
    sign String "" 用户签名,长度上限 256 字符,可设置为空字符串。
    email String "" 用户邮箱地址,需符合邮箱字符规则,例如 "zhangsan@xx.com",长度上限 64 字符,可设置为空字符串。
    birthday String "" 用户生日,例如 "xxxx-xx-xx",长度上限 16 字符,可设置为空字符串。
    mobile String "" 用户手机号,长度上限 32 字符,可设置为空字符串
    非中国大陆手机号码需要填写国家代码(如美国:+1-xxxxxxxxxx)或地区代码(如香港:+852-xxxxxxxx)
    gender Integer 0 用户性别,0:未知。1:男。2:女。
    serverExtension String - 用户资料扩展字段,建议使用 JSON 格式,长度上限为 1024 字符。
    createTime int - 用户资料创建时间。
    updateTime int 0 用户资料更新时间。

    阿里云通义千问
    JSON{
        "apiKey": "Bearer d1**2a", //必填
        "model": "qwen-turbo", //必填
        "workspace": "ws_QTggmeAxxxxx", //可选
        "prompt": "xxx",//必填
        "max_tokens": 2000//可选
        "top_p": 0.85//可选
        "repetition_penalty": 1.1,//可选
        ///....
    }
    
    微软 Azure OpenAI
    JSON{
        "apiKey": "xxxx",//必填
        "apiVersion": "2023-06-01-preview",//必填
        "deploymentId": "gpt_35_turbo",//必填
        "resourceName": "yunxintest",//必填
        "prompt": "xxx",//必填
        "max_tokens": 16,//可选
        "temperature": 1,//可选
        "top_p": 1,//可选
        "logit_bias": {},//可选
        "user": "xx",//可选
        "presence_penalty": 0,//可选
        "frequency_penalty": 0,//可选
        "best_of": 1,//可选
        ///....
    }
    
    定制本地大模型
    JSON{
        "model": "xxxx",//必填
        "url": "xxx",//必填
        "prompt": "xxx",//必填
        "mirostat": 1,//可选
        "mirostat_eta": 1//可选
        "temperature": 0.8//可选
        "top_p": 1,//可选
        ///....
    }
    

    NIMAIModelConfig

    数字人配置的 LLM(Large Language Models)模型的配置。

    dartNIMAIModelConfig({
    String? model,
    String? prompt,
    List? promptKeys,
    int? maxTokens,
    double? topP,
    double? temperature,
    })
    
    名称 类型 是否必填 默认值 说明
    model String - LLM 模型供应商提供的具体大模型版本模型名。
    prompt String - 提示词。
    promptKeys List - 提示词对应的变量,格式如: ["country", "suchAsChina"]。
    maxTokens int 0 模型最大 token 数量。

    topP

    double

    0.5

    一种称为核(Nucleus)抽样的策略,用来限制考虑用于生成的最高概率 token 的集合。

    • 设置一个较低的 top_p 值(例如 0.1),意味着只有概率最高的那些 token(这些 token 的累积概率达到或超过 0.1)会被考虑用于生成,这有助于排除那些非常低概率但可能引入噪声或不连贯性的 token。
    • 相反,如果 top_p 设得较高(如 0.75),则模型会在更广泛的概率分布中选择 token,这增加了多样性和创造性,但同时也可能降低生成文本的整体质量和连贯性。

    temperature

    double

    1

    用于调整模型输出的随机性,取值范围为 [0,2)。

    • 当 Temperature 较低(接近 0,不建议取值为 0)时,模型倾向于生成概率最高的 token,输出较为确定,重复性较高,接近训练数据中的常见模式。
    • 当 Temperature 较高时,模型会更加随机地选择 token,即使那些概率相对较低的 token 也可能被选中,导致生成的文本更加多样、新颖,但也可能更偏离常规或事实。

    NIMProxyAIModelCallParams

    数字人发起 LLM(Large Language Models)模型请求的配置参数。

    dartNIMProxyAIModelCallParams({
    String? accountId,
    String? requestId,
    NIMAIModelCallContent? content,
    List<NIMAIModelCallMessage?>? messages,
    String? promptVariables,
    NIMAIModelConfigParams? modelConfigParams,
    NIMProxyAICallAntispamConfig? antispamConfig,
    bool aiStream = false,
    })
    
    名称 类型 是否必填 默认值 说明
    accountId String - 数字人(AIUser)对应的账号 ID。
    requestId String - 请求 ID。
    content NIMAIModelCallContent - 数字人请求 LLM 模型的具体内容。
    messages List<NIMAIModelCallMessage> - 数字人请求 LLM 模型的上下文内容。
    promptVariables String - 提示词变量占位符替换内容,用于填充 prompt 中的变量。
  • 替换内容为一个 JSON 格式的字符串。
  • JSON 键来自于 NIMAIModelConfig 里的 promptKeys 属性。
  • 如果 NIMAIUser 中的 modelConfig.prompt 定义了变量,则服务端校验时必填。
  • 示例:
    {
    "career":"teacher"
    }
  • modelConfigParams NIMAIModelConfigParams - 请求接口模型相关参数配置,如果参数不为空,则默认覆盖控制相关配置。
    antispamConfig NIMProxyAICallAntispamConfig - 反垃圾配置,可复用消息体里的部分反垃圾字段。
    aiStream bool false 是否为流式响应输出。默认为 false(非流式)。

    NIMProxyAICallAntispamConfig

    数字人收发消息,是否需要经过安全通校验,即透传反垃圾内容配置。

    dartNIMProxyAICallAntispamConfig({
    bool? antispamEnabled,
    String? antispamBusinessId,
    })
    
    名称 类型 是否必填 默认值 说明
    antispamEnabled bool - 指定消息是否需要经过安全通校验。
  • 默认为 true,对于已开通安全通的用户有效,默认消息都会经过安全通校验。
  • 如果对单条消息设置为 false,则此消息不会经过安全通校验。
  • antispamBusinessId String - 指定网易易盾业务 ID。

    NIMAIModelCallContent

    数字人请求大模型或者大模型响应的消息内容。

    dartNIMAIModelCallContent({
    String? msg,
    required int type,
    })
    
    名称 类型 是否必填 默认值 说明
    msg String - 数字人请求或者响应的内容。
    type int - 请求或者响应的内容类型。暂时只有 0,代表文本,待后续扩展为其他内容类型。

    NIMAIModelCallMessage

    数字人请求大模型或者大模型响应的消息的上下文内容。

    dartNIMAIModelCallMessage({
    NIMAIModelRoleType? role,
    String? msg,
    required int type,
    })
    
    名称 类型 是否必填 默认值 说明
    role NIMAIModelRoleType - 上下文内容的角色。
    msg String - 数字人请求或者响应的上下文内容。
    type int - 请求或者响应的上下文内容类型。暂时只有 0,代表文本,待后续扩展为其他内容类型。

    NIMAIModelConfigParams

    数字人请求的 LLM 大模型配置覆盖设置。配置了该字段后,默认覆盖您在网易云信控制台上的相关配置。

    • 如果所有字段均为空,则以您在网易云信控制台上的配置为准,本地不做格式校验。
    • 如果设置参数超过范围,则会主动纠正到正确范围。
    dartNIMAIModelConfigParams({
    String? prompt,
    int? maxTokens,
    double? topP,
    double? temperature,
    })
    

    以下参数取值的详细说明,可参考 NIMAIModelConfig

    名称 类型 是否必填 默认值 说明
    prompt String - 提示词。
    maxTokens int - 模型最大 token 数量。
    topP double - 采样 P 参数,取值范围 (0,1)。
    temperature double - 温度参数,取值范围 (0,2)。

    NIMMessageAIConfigParams

    消息体中数字人配置的 LLM 大模型相关配置字段。

    dartNIMMessageAIConfigParams({
    String? accountId,
    NIMAIModelCallContent? content,
    List<NIMAIModelCallMessage?>? messages,
    String? promptVariables,
    NIMAIModelConfigParams? modelConfigParams,
    bool aiStream = false,
    })
    

    以下参数取值的详细说明,可参考 NIMAIModelConfig

    名称 类型 是否必填 默认值 说明
    accountId String - 数字人(AIUser)对应的账号 ID。
    content NIMAIModelCallContent - 数字人请求 LLM 模型的具体内容。
    messages List<NIMAIModelCallMessage> - 数字人请求 LLM 模型的上下文内容。
    promptVariables String - 提示词变量占位符替换内容,用于填充 prompt 中的变量。
  • 替换内容为一个 JSON 格式的字符串。
  • JSON 键来自于 NIMAIModelConfig 里的 promptKeys 属性。
  • 如果 NIMAIUser 中的 modelConfig.prompt 定义了变量,则服务端校验时必填。
  • 示例:
    {
    "职业":"厨师"
    }
  • modelConfigParams NIMAIModelConfigParams - 请求接口模型相关参数配置,如果参数不为空,则默认覆盖控制相关配置。
    aiStream bool false 是否为流式响应输出。默认为 false(非流式)。

    NIMAIModelCallResult

    透传接口下数字人回复消息的的结构体。

    dartNIMAIModelCallResult({
    String? accountId,
    String? requestId,
    NIMAIModelCallContent? content,
    int? code,
    List<NIMAIRAGInfo>? aiRAGs,
    int timestamp = 0,
    bool aiStream = false,
    V2NIMAIModelStreamCallStatus? aiStreamStatus,
    })
    
    名称 类型 是否必填 默认值 说明
    code int 200 数字人响应消息的状态码。
    accountId String - 收发消息的数字人的账号 ID(accountId)。
    requestId String - 本次响应的标识。
    content NIMAIModelCallContent - 请求 LLM 模型的回复消息。
    aiRAGs List<NIMAIRAGInfo> - 数字人回复内容的引用资源列表。
    timestamp int - 回复的时间戳。
    aiStream bool false 是否为流式响应输出。默认为 false(非流式)。
    aiStreamStatus V2NIMAIModelStreamCallStatus V2NIM_AI_MODEL_STREAM_CALL_STATUS_NONE 数字人流式响应输出状态。

    NIMMessageAIConfig

    消息体中数字人消息收发相关配置字段。

    dartNIMMessageAIConfig({
    String? accountId,
    NIMMessageAIStatus? aiStatus,
    List<NIMAIRAGInfo>? aiRAGs,
    bool aiStream = false,
    V2NIMMessageAIStreamStatus? aiStreamStatus,
    NIMMessageAIStreamChunk? aiStreamLastChunk,
    })
    
    名称 类型 是否必填 默认值 说明
    accountId String - 收发消息的数字人的账号 ID(accountId)。
    aiStatus NIMMessageAIStatus - 该数字人收发的消息的询问和应答标识。
  • 0 表示普通消息
  • 1 表示是一个艾特数字人的消息
  • 2 表示是数字人响应艾特的消息
  • aiRAGs List<NIMAIRAGInfo> - 数字人回复内容的引用资源列表。
    aiStream bool false 是否为流式响应输出。默认为 false(非流式)。
    aiStreamStatus V2NIMMessageAIStreamStatus V2NIM_MESSAGE_AI_STREAM_STATUS_NONE 数字人流式消息状态。
    aiStreamLastChunk NIMMessageAIStreamChunk - 数字人流式消息最近一个分片。流式输出过程中的消息内容(text)是接收到的分片组装好之后的结果。

    NIMAIRAGInfo

    数字人回复内容的引用资源。

    dartNIMAIRAGInfo({
    String url = '',
    String name = '',
    int time = 0,
    String description = '',
    String icon = '',
    String title = '',
    })
    
    名称 类型 是否必存在 默认值 说明
    name String - RAG 名称。
    icon String - RAG 图标。
    title String - 引用资源的标题。
    description String - 引用资源的描述。
    time int 0 引用资源的时间。
    url String - 引用资源的 URL。

    NIMMessageAIStreamChunk

    数字人流式消息最近一个分片。

    dartNIMMessageAIStreamChunk({
    String? content,
    int? messageTime,
    int? chunkTime,
    int type = 0,
    int? index,
    })
    
    名称 类型 是否必存在 默认值 说明
    content String - 数字人流式回复分片文本内容。
    messageTime int - 数字人流式消息时间,即占位消息时间。
    chunkTime int - 数字人流式消息当前分片时间。
    chunkTime >= messageTime
    type int - 消息类型,当前仅支持文本类型(0)。
    index int - 分片序号,从 0 开始。

    NIMMessageAIStreamStopParams

    停止数字人流式输出配置参数。

    dartNIMMessageAIStreamStopParams({
    required V2NIMMessageAIStreamStopOpType operationType,
    String? updateContent,
    })
    
    名称 类型 是否必填 默认值 说明
    operationType V2NIMMessageAIStreamStopOpType - 停止流式消息的操作类型。
    updateContent String - 更新的消息内容,仅当 operationType = V2NIM_MESSAGE_AI_STREAM_STOP_OP_UPDATE 时有效。

    NIMMessageAIRegenParams

    重新输出数字人消息配置参数。

    dartNIMMessageAIRegenParams({
    required V2NIMMessageAIRegenOpType operationType,
    })
    
    名称 类型 是否必填 默认值 说明
    operationType V2NIMMessageAIRegenOpType - 重新输出数字人消息的操作类型。

    NIMAIModelStreamCallChunk

    透传接口的 AI 流式消息分片信息。

    dartNIMAIModelStreamCallChunk({
    String? content,
    int? chunkTime,
    int type = 0,
    int index = 0,
    })
    
    名称 类型 是否必存在 默认值 说明
    content String - 数字人流式回复分片文本内容。
    chunkTime int - 数字人流式消息当前分片时间。
    type int - 消息类型,当前仅支持文本类型(0)。
    index int - 分片序号,从 0 开始。

    NIMAIModelStreamCallContent

    透传接口的 AI 流式消息回复内容。

    dartNIMAIModelStreamCallContent({
    String? msg,
    int type = 0,
    NIMAIModelStreamCallChunk? lastChunk,
    })
    
    名称 类型 是否必存在 默认值 说明
    msg String - 数字人流式回复分片组装好后的文本消息。
    type int - 消息类型,当前仅支持文本类型(0)。
    lastChunk NIMAIModelStreamCallChunk - 透数字人流式消息回复的最近一个分片信息。

    NIMAIModelStreamCallResult

    透传接口的 AI 流式回复的结构体。

    dartNIMAIModelStreamCallResult({
    int code = 200,
    required String accountId,
    required String requestId,
    NIMAIModelStreamCallContent? content,
    List<NIMAIRAGInfo>? aiRAGs,
    int? timestamp,
    })
    
    名称 类型 是否必存在 是否只读 默认值 说明
    code int 200 AI 响应的状态码。
    accountId String - - 数字人的云信账号 ID。
    requestId String - - 本次响应的标识。
    content NIMAIModelStreamCallContent - - 请求 AI 的回复。
    aiRAGs List<NIMAIRAGInfo> - - 数字人回复内容的引用资源列表。
    timestamp int - - 分片的时间戳。

    NIMAIModelStreamCallStopParams

    停止透传接口的 AI 流式回复。

    dartNIMAIModelStreamCallStopParams({
    required String accountId,
    required String requestId,
    })
    
    名称 类型 是否必填 是否只读 默认值 说明
    accountId String - - 数字人的云信账号 ID。
    requestId String - - 本次响应的标识。

    NIMUserUpdateParam

    用户资料更新参数。

    dartNIMUserUpdateParam({
    String? name,
    String? avatar,
    String? sign,
    int? gender,
    String? email,
    String? birthday,
    String? mobile,
    String? serverExtension,
    })
    
    名称 类型 是否必填 说明
    name String 用户昵称,长度上限 64 字符
  • 为空(null)表示不修改该字段
  • 为空字符串("")则返回参数错误。
  • avatar String 用户头像的 URL 地址,例如 "https://netease/xxx.png",长度上限 1024 字符
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")
  • sign String 用户签名,长度上限 256 字符
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")
  • email String 用户邮箱地址,需符合邮箱字符规则,例如 "zhangsan@xx.com",长度上限 64 字符
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")串。
  • birthday String 用户生日,例如 "xxxx-xx-xx",长度上限 16 字符
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")
  • mobile String 用户手机号,长度上限 32 字符
    非中国大陆手机号码需要填写国家代码(如美国:+1-xxxxxxxxxx)或地区代码(如香港:+852-xxxxxxxx)
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")
  • gender int 用户性别,0:未知。1:男。2:女
    设置为其它值会返回参数错误。
    serverExtension String 用户资料扩展字段,建议使用 JSON 格式,长度上限为 1024 字符
  • 为空(null)表示不修改该字段
  • 可设置为空字符串("")
  • NIMUserSearchOption

    根据关键字搜索用户信息的配置参数。

    dartNIMUserSearchOption({
    required String keyword,
    bool? searchName,
    bool? searchAccountId,
    bool? searchMobile,
    })
    
    名称 类型 是否必填 默认值 说明
    keyword String - 搜索关键字,默认搜索用户的昵称,可以指定是否同时搜索用户账号或手机号。
    searchName bool true 是否搜索用户的昵称。
    searchAccountId bool false 是否搜索用户账号。
    searchMobile bool false 是否搜索用户的手机号。

    NIMFriend

    好友信息对象。

    dartNIMFriend({
    required String accountId,
    String? alias,
    String? serverExtension,
    String? customerExtension,
    required int createTime,
    int? updateTime,
    NIMUserInfo? userProfile,
    })
    
    名称 类型 是否必填 默认值 是否只读 说明
    accountId String - - 好友账号 ID
    alias String - - 好友备注,长度上限 128 字符。
    serverExtension String - - 好友信息扩展字段,建议使用 JSON 格式,长度上限为 256 字符
    客户端和服务端都可修改该字段。
    customerExtension String - - 好友信息客户端扩展字段,建议使用 JSON 格式,长度上限为 256 字符
    仅服务端可修改该字段。
    createTime int - - 好友信息创建时间。
    updateTime int 0 - 好友信息更新时间。
    userProfile NIMUserInfo - - 好友的用户信息。

    NIMFriendAddParams

    添加好友的配置参数。

    dartNIMFriendAddParams({
    required NIMFriendAddMode addMode,
    String? postscript,
    })
    
    名称 类型 是否必填 默认值 说明
    addMode NIMFriendAddMode NIMFriendAddMode.nimFriendModeTypeAdd:直接添加为好友,无需验证 添加好友模式。
    postscript String - 添加/申请添加好友的附言。

    NIMFriendAddApplication

    申请添加好友相关操作信息。

    dartNIMFriendAddApplication({
    String? applicantAccountId,
    String? recipientAccountId,
    String? operatorAccountId,
    String? postscript,
    NIMFriendAddApplicationStatus? status,
    int? timestamp,
    bool? read,
    })
    
    名称 类型 是否必填 是否只读 说明
    applicantAccountId String 好友申请者账号。
    recipientAccountId String 被申请为好友的账号。
    operatorAccountId String 操作者账号 ID
    postscript String 操作时添加的附言。
    status NIMFriendAddApplicationStatus 操作的状态。
    timestamp int 操作的时间。
    read bool 是否已读。

    NIMFriendDeleteParams

    删除好友的配置参数。

    dartNIMFriendDeleteParams({
    bool? deleteAlias,
    })
    
    名称 类型 是否必填 默认值 说明
    deleteAlias bool false 是否删除备注,false:不删除。true:删除。

    NIMFriendSetParams

    设置好友信息的配置参数。

    可以设置别名和扩展字段,两字段都可选,但是不能都不传,都不传回返回参数错误。

    dartNIMFriendSetParams({
    String? alias,
    String? serverExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    alias String - 别名
  • 不传表示不设置
  • 为空字符串表示清空别名。
  • serverExtension String - 扩展字段
  • 不传表示不设置
  • 为空字符串表示清空扩展字段。
  • NIMFriendAddApplicationQueryOption

    申请添加好友相关操作信息的查询参数。

    dartNIMFriendAddApplicationQueryOption({
    required int? offset,
    required int? limit,
    List<NIMFriendAddApplicationStatus>? status,
    })
    
    名称 类型 是否必填 默认值 说明
    offset int - 分页查询偏移。首次查询传 0,下一次查询传入上一次查询返回值中的 offset(不包含 offset)。
    limit int 50 单次查询的最大数量。
    status List<NIMFriendAddApplicationStatus> - 申请添加好友相关操作状态列表。如果列表为空或 size 为 0 则表示查询所有申请添加好友相关操作信息。

    NIMFriendAddApplicationResult

    查询申请添加好友相关操作信息列表的返回结果。

    dartNIMFriendAddApplicationResult({
    List<NIMFriendAddApplication>? infos,
    required int offset,
    bool? finished,
    })
    
    名称 类型 是否只读 说明
    infos List<NIMFriendAddApplication> 查询返回的申请添加好友相关操作信息列表。
    offset int 下一下查询的偏移量。
    finished bool 是否分页结束。

    NIMFriendSearchOption

    根据关键字搜索好友信息的配置参数。

    dartNIMFriendSearchOption({
    required String keyword,
    bool searchAlias = true,
    bool searchAccountId = true,
    })
    
    名称 类型 是否必填 默认值 说明
    keyword String - 搜索关键字,默认搜索好友的备注,可以指定是否同时搜索用户账号。
    searchAlias bool true 是否搜索好友的备注。
    searchAccountId bool false 是否搜索用户账号。

    V2NIMUserInfoConfig

    消息发送方的用户信息配置。

    dartV2NIMUserInfoConfig({
    String? senderAvatar,
    String? senderExtension,
    String? senderNick,
    int? userInfoTimestamp,
    })
    
    名称 类型 是否必填 默认值 说明
    userInfoTimestamp int null 消息发送方用户信息的最后更新时间。
    senderNick String null 消息发送方的昵称。
    senderAvatar String null 消息发送方的头像。
    senderExtension String null 消息发送方的服务端扩展字段,多端同步。

    NIMUploadFileTask

    文件上传任务。

    dartNIMUploadFileTask({
    String? taskId,
    NIMUploadFileParams? uploadParams,
    })
    
    名称 类型 是否必填 默认值 说明
    taskId String - 任务 ID
    uploadParams NIMUploadFileParams - 文件上传参数。

    NIMUploadFileParams

    文件上传任务。

    dartNIMUploadFileParams({
    String? filePath,
    String? sceneName,
    })
    
    名称 类型 是否必填 默认值 说明
    filePath String - 文件地址。
    sceneName String DEFAULT_PROFILE 对应场景名,默认为 nim_default_profile_icon 场景名。
    使用自定义场景前,需要先调用 addCustomStorageScene 新增自定义场景名。

    NIMAntispamConfig

    若需要使用反垃圾检测,但不使用网易云信安全通默认配置,则需要通过该类定制审核规则。

    dartNIMAntispamConfig({
    String? antispamBusinessId,
    })
    
    名称 类型 是否必填 默认值 说明
    antispamBusinessId String - 指定易盾业务 ID。样例:JSON 格式 {"textbid":"","picbid":""}

    NIMSDKOption(仅 iOS)

    初始化配置选项。

    Objective-C@interface NIMSDKOption : NSObject
    @property (nonatomic,copy)          NSString    *appKey;
    @property (nullable,nonatomic,copy) NSString    *apnsCername;
    @property (nullable,nonatomic,copy) NSString    *pkCername;
    + (instancetype)optionWithAppKey:(NSString *)appKey;
    @end
    

    类方法

    注册网易云信应用 AppKey。

    Objective-C+ (instancetype)optionWithAppKey:(NSString *)appKey;
    
    名称 类型 是否必填 说明
    appKey NSString 网易云信控制台获取到的 App Key。
    apnsCername NSString APNs 推送证书名,如不需要实现离线推送可不配置。
    pkCername NSString PushKit 推送证书名,如不需要实现离线推送可不配置。

    NIMPCSDKOptions(仅 macOS/Windows)

    10.x.x 版本 SDK 的 macOS/Windows 平台初始化配置选项。

    dartNIMPCSDKOptions({
    required NIMBasicOption basicOption,
    NIMLinkOption? linkOption,
    NIMDatabaseOption? databaseOption,
    NIMFCSOption? fcsOption,
    NIMPrivateServerOption? privateServerOption,
    required String appKey,
    String? sdkRootDir,
    })
    
    名称 类型 是否必填 说明
    appkey String 网易云信应用的 AppKey。
    sdkRootDir String 应用的数据目录,为空则使用默认目录。
    basicOption NIMBasicOption 基础配置。
    linkOption NIMLinkOption 连接相关配置。
    databaseOption NIMDatabaseOption 数据库配置。
    fcsOption NIMFCSOption 融合存储配置。
    privateServerOption NIMPrivateServerOption 私有化配置。

    NIMUpdatedTeamInfo

    群信息更新。

    dartNIMUpdatedTeamInfo({
    String? name,
    int? memberLimit,
    String? intro,
    String? announcement,
    String? avatar,
    String? serverExtension,
    NIMTeamJoinMode? joinMode,
    NIMTeamAgreeMode? agreeMode,
    NIMTeamInviteMode? inviteMode,
    NIMTeamUpdateInfoMode? updateInfoMode,
    NIMTeamUpdateExtensionMode? updateExtensionMode,
    int? chatBannedMode,
    })
    
    名称 类型 是否只读 默认值 说明
    name String - 群组名称
  • 若为空,则表示不修改该字段
  • 若为空串,返回参数错误。
  • memberLimit int - 群组人数上限。若为空,则表示不修改。
  • 高级群:默认 200 人/群(免费),可通过 网易云信控制台配置为 500/1000/2000 人/群(计费),最大可扩展至 5000 人/群(联系商务经理或技术支持)。
  • 超大群:默认 2000 人/群,可通过网易云信控制台 配置为 2000-10000 人/群。
  • 2000 人以上的群必须由服务端 API 发起创建。
  • intro String - 群组介绍,最大为 255 个字符。
    若为空,则表示不修改该字段。
    announcement String - 群组公告,最大为 5000 个字符。
    若为空,则表示不修改该字段。
    avatar String - 群组头像
    若为空,则表示不修改该字段。
    serverExtension String - 群组服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    若为空,则表示不修改该字段。
    joinMode NIMTeamJoinMode NIMTeamJoinMode.joinModeFree 无需验证 入群验证模式。
    agreeMode NIMTeamAgreeMode NIMTeamAgreeMode.agreeModeAuth 需要被邀请人同意 被邀请人同意模式。
    inviteMode NIMTeamInviteMode NIMTeamInviteMode.inviteModeManager 仅群主或管理员可以邀请其他人入群 群组邀请模式,即群主/管理员或普通成员可以邀请入群。
    updateInfoMode NIMTeamUpdateInfoMode NIMTeamUpdateInfoMode.updateInfoModeManager 仅群主或管理员可以修改群组资料 群组资料修改模式。
    updateExtensionMode NIMTeamUpdateExtensionMode NIMTeamUpdateExtensionMode.updateExtensionModeManager 仅群主或管理员可以修改群组资料 群组扩展字段修改模式。
    chatBannedMode int 0,不禁言 群组禁言状态。

    NIMDownloadFileProgress

    文件下载进度。

    dartNIMDownloadFileProgress({
      String? url,
      int? progress,
    });
    
    名称 类型 是否只读 说明
    url String 文件下载地址。
    progress int 文件下载进度。

    NIMUploadFileProgress

    文件上传进度。

    dartNIMUploadFileProgress({
    String? taskId,
    int? progress,
    })
    
    名称 类型 是否只读 说明
    taskId String 文件下载任务 ID。
    progress int 文件上传进度。

    NIMDownloadMessageAttachmentProgress

    消息附件下载进度。

    dartNIMDownloadMessageAttachmentProgress({
    NIMDownloadMessageAttachmentParams? downloadParam,
    int? progress,
    })
    
    名称 类型 是否只读 说明
    downloadParam NIMDownloadMessageAttachmentParams 文件下载任务 ID。
    progress int 消息附件下载进度。

    NIMSubscribeUserStatusOption

    订阅用户状态的配置参数。

    DartNIMSubscribeUserStatusOption({
    required List<String> accountIds,
    int? duration,
    bool? immediateSync,
    })
    
    名称 类型 是否必填 默认值 说明
    accountIds List<String> - 订阅的成员列表,为空返回参数错误,单次订阅的数量不超过 100 个,超限则返回参数错误。
    duration int 60s 订阅的有效期。
  • 时间范围为 60s ~ 2592000s(302460*60s)。
  • 过期后需要重新订阅。如果未过期的情况下重复订阅,新设置的有效期会覆盖之前的有效期。
  • immediateSync bool false 订阅后是否立即同步事件状态值。默认为 false,即不立即同步。若设置为 true,表示立即同步当前状态值。但为了性能考虑,30s 内重复订阅,会忽略该参数。

    NIMUserStatus

    用户状态对象。

    DartNIMUserStatus({
    required String accountId,
    required NIMClientType clientType,
    int? statusType,
    required int publishTime,
    required String uniqueId,
    String? extension,
    String? serverExtension,
    })
    
    名称 类型 是否必填 是否只读 默认值 说明
    accountId String - 用户账号 ID。
    statusType int - 在线状态类型。0:未知;1:登录;2:登出;3:断开连接;自定义设置值:10000 及以上(9999 以内为预定义值,不可使用)。
    clientType NIMClientType - 用户发布状态对应的终端。
    publishTime int - 用户发布状态的时间,服务端时间。
    uniqueId String - 每次发布时,会生成一个唯一 ID, 发布自定义事件时会生成该参数,如果 ID 相同,表示同一个事件。
    extension String - 用户发布状态时设置的扩展字段。
    serverExtension String - 获取预留状态中的配置信息,JSONArray 格式,由服务端填入。

    NIMUnsubscribeUserStatusOption

    取消订阅用户状态的配置参数。

    DartNIMUnsubscribeUserStatusOption({required this.accountIds});
    
    名称 类型 是否必填 默认值 说明
    accountIds List<String> - 取消订阅的成员列表,为空则表示取消所有订阅的成员,否则取消指定的成员。单次取消订阅的数量不超过 100,超过返回 191004 错误。

    NIMCustomUserStatusParams

    自定义用户状态对象。

    DartNIMCustomUserStatusParams({
    int? statusType,
    int? duration,
    String? extension,
    bool? onlineOnly,
    bool? multiSync,
    })
    
    名称 类型 是否必填 默认值 说明
    statusType int - 自定义状态设置值,10000 及以上(9999 以内为预定义值,不可使用)。若设置的值小于 10000 或超过 Int 上限,则返回参数错误。
    duration int 60s 自定义状态的有效期,范围为 60s ~ 604800s(72460*60s)。
    extension String - 用户发布状态时设置的扩展字段。
    onlineOnly bool true 用户发布状态时是否只广播给在线的订阅者。
    multiSync bool false 用户发布状态时是否需要多端同步。

    NIMUserStatusSubscribeResult

    用户状态订阅的结果。

    DartNIMUserStatusSubscribeResult({
    required String accountId,
    int? duration,
    int? subscribeTime,
    })
    
    名称 类型 是否必填 是否只读 默认值 说明
    accountId String - 查询的用户账号 ID。
    duration int 60s 订阅的有效期,范围为 60s ~ 2592000s(302460*60s)。
    subscribeTime int - 订阅时间。

    NIMCustomUserStatusPublishResult

    自定义用户状态发布结果。

    DartNIMCustomUserStatusPublishResult({
    required String uniqueId,
    String? serverId,
    int? publishTime,
    })
    
    名称 类型 是否必填 是否只读 默认值 说明
    uniqueId String - 发布自定义用户状态时,内部生成的唯一ID。
    serverId String - 服务器针对该状态事件生成的 ID。
    publishTime int - 用户状态发布时的时间。

    NIMStatusBarNotificationConfig

    通知栏配置。

    DartNIMStatusBarNotificationConfig({
    bool ring = true,
    String? notificationSound,
    bool vibrate = true,
    int? ledARGB,
    int? ledOnMs,
    int? ledOffMs,
    bool hideContent = false,
    bool downTimeToggle = false,
    String? downTimeBegin,
    String? downTimeEnd,
    bool downTimeEnableNotification = true,
    String? notificationEntranceClassName,
    bool titleOnlyShowAppName = false,
    NIMNotificationFoldStyle notificationFoldStyle = NIMNotificationFoldStyle.all,
    int? notificationColor,
    bool showBadge = true,
    String? customTitleWhenTeamNameEmpty,
    NIMNotificationExtraType notificationExtraType = NIMNotificationExtraType.message,
    })
    
    名称 类型 是否必填 默认值 说明
    ring bool true 是否需要响铃提醒。
    notificationSound String - 响铃提醒的声音资源,如果不提供,使用系统默认提示音。
    vibrate bool true 是否需要振动提醒。
    ledARGB int - 呼吸灯的颜色。建议尽量使用绿色、蓝色、红色等基本颜色,避免使用混合色。
    ledOnMs int - 呼吸灯亮时的持续时间(毫秒)。
    ledOffMs int - 呼吸灯熄灭时的持续时间(毫秒)。
    hideContent bool false 不显示消息详情开关,同时也不再显示消息发送者昵称。
    downTimeToggle bool false 免打扰设置开关,默认为关闭
    downTimeBegin String - 免打扰的开始时间,格式为 HH:mm (24小时制)。
    downTimeEnd String - 免打扰的结束时间,格式为HH:mm(24小时制)。如果结束时间小于开始时间,免打扰时间为开始时间-24:00-结束时间。
    downTimeEnableNotification bool true 免打扰期间,是否显示通知,默认为显示。
    notificationEntranceClassName String - 通知栏提醒的响应 intent 的 activity 类型,通过配置该参数实现消息提醒通知栏的跳转。
    titleOnlyShowAppName bool false 通知栏提醒的标题是否只显示应用名。默认是 false,当有一个会话发来消息时,显示会话名;当有多个会话发来时,显示应用名。
    notificationFoldStyle NIMNotificationFoldStyle NIMNotificationFoldStyle.all 消息通知栏的折叠类型。
    notificationColor int - 消息通知栏颜色。
    showBadge bool true APP 图标是否显示未读数(红点)。仅针对 Android 8.0+ 有效。
    customTitleWhenTeamNameEmpty String - 通知栏标题,如果群名称为 null 或者空串,则使用该字段作为通知栏 title。
    notificationExtraType NIMNotificationExtraType NIMNotificationExtraType.message 点击在线通知的通知栏传递的 extra 类型。

    V2NIMChatroomClient

    聊天室实例入口类。

    成员参数

    参数名称 类型 说明
    instanceId int 实例 ID。

    成员函数

    • getChatroomInfo:获取聊天室信息。
    • getChatroomService:获取聊天室服务。后续聊天室相关操作(聊天室成员、消息等)均在返回的 V2NIMChatroomService 类中实现。
    • getChatroomQueueService:获取聊天室队列服务。后续聊天室队列相关操作均在返回的 V2NIMChatroomQueueService 类中实现。
    • enter:进入聊天室。
    • exit:退出聊天室。
    • getInstanceId:获取实例 ID。

    V2NIMChatroomEnterParams

    进入聊天室相关参数。

    DartV2NIMChatroomEnterParams({
    String? accountId,
    String? serverExtension,
    bool anonymousMode = false,
    NIMAntispamConfig? antispamConfig,
    NIMLoginAuthType? authType,
    V2NIMChatroomLocationConfig? locationConfig,
    String? notificationExtension,
    String? roomAvatar,
    String? roomNick,
    V2NIMChatroomTagConfig? tagConfig,
    int? timeout,
    String? token,
    })
    
    参数名称 类型 是否必填 默认值 说明
    anonymousMode bool false 是否为匿名模式。
    在匿名模式下不能发消息,只能收消息。
    accountId String null 用户账号。
  • 若为匿名模式,则可以不填,SDK 内部会生成账号,建议全局缓存。
  • 如果为非匿名模式,则必须为合法账号。
  • token String null 静态 token,可以不填。
    roomNick String 账号对应信息 进入聊天室后显示的昵称。
    可以不填,默认显示账号对应相关信息,例如:匿名模式则默认昵称为账号名称。
    roomAvatar String 账号对应信息 进入聊天室后显示的头像,可通过 StorageService.uploadFile 方法上传头像。
    可以不填,默认显示账号对应相关信息,例如:匿名模式则默认头像为空。
    timeout int 60 调用 enter 方法进入聊天室超时时间。
    若超过该时间未成功进入聊天室,则返回失败回调。
    authType NIMLoginAuthType 0 鉴权方式,包括静态 Token 鉴权(默认)、动态 Token 鉴权、通过第三方回调鉴权。
    serverExtension String null 服务端扩展字段,建议使用 JSON 格式,多端同步。长度限制与各套餐的配置(消息扩展字段上限调整)有关,具体请参考 字段限制说明
    notificationExtension String null 进入聊天室通知的扩展字段,长度上限为 2048 字节。
    tagConfig V2NIMChatroomTagConfig null 进入聊天室的标签信息配置。
    locationConfig V2NIMChatroomLocationConfig null 进入聊天室的空间位置信息配置。
    antispamConfig NIMAntispamConfig null 网易易盾反垃圾检测。
  • 若不需要反垃圾检测,或已开启安全通,则不需要配置。
  • 若不使用安全通默认配置,需要定制审核规则,则配置该字段。
  • V2NIMChatroomTagConfig

    聊天室标签配置信息。

    DartV2NIMChatroomTagConfig({
    String? notifyTargetTags,
    List<String>? tags,
    })
    
    名称 类型 是否必填 默认值 说明
    tags List<String> null 聊天室标签列表。
    notifyTargetTags String null 进入/退出聊天室通知标签信息,标签表达式请参考 聊天室标签管理

    V2NIMChatroomEnterResult

    进入聊天室结果。

    DartV2NIMChatroomEnterResult({
    V2NIMChatroomInfo? chatroom,
    V2NIMChatroomMember? selfMember,
    })
    
    名称 类型 是否只读 说明
    chatroom V2NIMChatroomInfo 聊天室信息。
    selfMember V2NIMChatroomMember 聊天室成员用户信息:
  • 必返回字段:roomId、accountId、memberRole、enterTime
  • 根据入参是否设置决定是否返回:roomNick、roomAvatar、serverExtension、tags、notifyTargetTags
  • 根据历史状态决定是否返回:chantBanned、tempChatBanned、tempChatBannedDuration
  • 以是否修改过决定是否返回:isOnline:true、blocked:false、memberLevel
  • updateTime:返回 0
  • V2NIMChatroomInfo

    聊天室信息。

    DartV2NIMChatroomInfo({
    String? serverExtension,
    String? announcement,
    bool? chatBanned,
    String? creatorAccountId,
    String? liveUrl,
    int? onlineUserCount,
    V2NIMChatroomQueueLevelMode? queueLevelMode,
    String? roomId,
    String? roomName,
    bool? isValidRoom,
    })
    
    名称 类型 是否只读 说明
    roomId String 聊天室 ID。
    roomName String 聊天室名称。
    announcement String 聊天室公告。
    liveUrl String 视频直播拉流地址。
    isValidRoom bool 聊天室是否有效。
    serverExtension String 聊天室服务端扩展字段。必须为 JSON 格式封装,长度上限为 2048 字节,多端同步。
    queueLevelMode V2NIMChatroomQueueLevelMode 聊天室队列操作权限模式。
    creatorAccountId String 聊天室创建者用户账号。
    onlineUserCount int 聊天室当前在线用户数量。
    chatBanned bool 聊天室是否处于禁言状态:
  • true:禁言
  • false:非禁言。
  • V2NIMChatroomMessage

    聊天室消息对象。

    DartV2NIMChatroomMessage({
    int? subType,
    NIMMessageRouteConfig? routeConfig,
    NIMMessageAntispamConfig? antispamConfig,
    String? text,
    String? serverExtension,
    NIMMessageAttachment? attachment,
    V2NIMChatroomMessageConfig? messageConfig,
    String? messageClientId,
    int? createTime,
    String? senderId,
    NIMMessageSendingState? sendingState,
    bool? isSelf,
    NIMMessageType? messageType,
    NIMMessageAttachmentUploadState? attachmentUploadState,
    String? callbackExtension,
    V2NIMLocationInfo? locationInfo,
    String? notifyTargetTags,
    String? roomId,
    int? senderClientType,
    V2NIMUserInfoConfig? userInfoConfig,
    })
    
    名称 类型 是否必填 是否只读 说明
    messageClientId String 消息客户端 ID。
    客户端生成的 UUID,不多端同步。
    senderClientType int 消息发送方的登录客户端类型,服务端返回。
    createTime int 消息创建时间戳(毫秒),服务端返回。
    在消息发送成功前,该字段为发送者本地时间。
    senderId String 消息发送方账号。
    roomId String 聊天室 ID。
    isSelf bool 消息发送方是否为本人。
    attachmentUploadState NIMMessageAttachmentUploadState 消息附件上传状态。
    sendingState NIMMessageSendingState 消息发送状态。
    messageType NIMMessageType 消息类型。
    subType int - 自定义消息子类型,0 代表无消息子类型。
    text String - 消息文本内容,仅文本类型的消息有该字段。不超过 5000 字符。
    attachment NIMMessageAttachment - 消息附件,仅图片、语音、视频、文件类型消息有该字段。
    serverExtension String - 消息服务端扩展字段,多端同步。不超过 2048 字节。
    callbackExtension String 第三方回调透传的自定义扩展字段,不超过 2048 字节。
    routeConfig NIMMessageRouteConfig 消息事件抄送相关配置。
    消息抄送功能需要在 网易云信控制台开通
    antispamConfig NIMMessageAntispamConfig 反垃圾相关配置。
    反垃圾功能包括客户端反垃圾和安全通,均需要在 网易云信控制台开通
    notifyTargetTags String - 消息通知标签信息,标签表达式请参考 聊天室标签管理
    messageConfig V2NIMChatroomMessageConfig 聊天室消息配置。
    userInfoConfig V2NIMUserInfoConfig 消息发送方用户信息配置。
    locationInfo V2NIMLocationInfo - 消息空间位置信息配置。

    V2NIMChatroomMessageConfig

    聊天室消息配置信息。

    DartV2NIMChatroomMessageConfig({
    bool? highPriority,
    bool? historyEnabled,
    })
    
    名称 类型 是否必填 默认值 说明
    historyEnabled bool true 是否需要在服务端保存历史消息。
    highPriority bool false 是否是高优先级消息。
    在超频情况下,默认先流控低优先级消息。

    V2NIMLocationInfo

    聊天室空间坐标信息。

    DartV2NIMLocationInfo({
    double? x,
    double? y,
    double? z,
    })
    
    名称 类型 是否必填 默认值 说明
    x double - 聊天室空间 x 坐标。
    y double - 聊天室空间 y 坐标。
    z double - 聊天室空间 z 坐标。

    V2NIMChatroomKickedInfo

    被踢出聊天室信息。

    DartV2NIMChatroomKickedInfo( String? serverExtension, V2NIMChatroomKickedReason? kickedReason )
    
    名称 类型 是否只读 是否必填 说明
    kickedReason V2NIMChatroomKickedReason 被踢原因。
    serverExtension String 被踢信息的服务端扩展字段,多端同步。

    V2NIMChatroomMember

    聊天室成员信息。

    DartV2NIMChatroomMember({
    String? roomNick,
    String? roomAvatar,
    int? enterTime,
    String? roomId,
    String? notifyTargetTags,
    String? serverExtension,
    V2NIMChatroomMemberRole? memberRole,
    String? accountId,
    bool? blocked,
    bool? chatBanned,
    int? memberLevel,
    List<V2NIMChatroomEnterInfo>? multiEnterInfo,
    bool? isOnline,
    List<String>? tags,
    bool? tempChatBanned,
    int? tempChatBannedDuration,
    int? updateTime,
    bool? valid,
    })
    
    名称 类型 是否只读 默认值 说明
    roomId String - 聊天室 ID。
    accountId String - 聊天室成员用户账号。
    memberRole V2NIMChatroomMemberRole - 聊天室成员角色类型。
    memberLevel int 0,表示未设置 聊天室成员等级,大于或等于 0 的整数。
    roomNick String - 聊天室中显示昵称。
    roomAvatar String - 聊天室中显示头像。
    serverExtension String - 聊天室成员服务端扩展字段,多端同步。建议 JSON 格式,长度上限为 2048。
    isOnline bool - 聊天室用户是否在线。
    blocked bool - 聊天室用户是否在黑名单列表中。
    chatBanned bool - 聊天室用户是否处于禁言状态。
    tempChatBanned bool - 聊天室用户是否处于临时禁言状态。
    tempChatBannedDuration int 0 聊天室临时禁言时长(秒)
    tags List<String> - 聊天室登录终端标签。
    notifyTargetTags String - 聊天室登录登出通知标签,请参考 标签表达式
    enterTime int 0 用户进入聊天室时间戳。
    固定成员离线后该字段为 0。
    updateTime int - 固定成员 (创建者、管理员、普通成员)更新时间戳。
    valid bool - 预留字段。
    multiEnterInfo List<V2NIMChatroomEnterInfo> - 聊天室多端登录信息。
    同一个账号可以登录多个终端,多个终端同时在线。

    V2NIMChatroomEnterInfo

    进入聊天室信息。

    DartV2NIMChatroomEnterInfo({
    int? clientType,
    int? enterTime,
    String? roomAvatar,
    String? roomNick,
    })
    
    名称 类型 是否只读 默认值 说明
    roomNick String - 进入聊天室后显示的昵称。
    roomAvatar String - 进入聊天室后显示的头像。
    enterTime int 0 用户进入聊天室时间戳。离线成员该字段为 0。
    clientType int 0,表示未设置 进入聊天室终端类型。

    V2NIMSendChatroomMessageParams

    聊天室消息发送配置参数。

    DartV2NIMSendChatroomMessageParams({
    V2NIMChatroomMessageConfig? messageConfig,
    NIMMessageRouteConfig? routeConfig,
    NIMMessageAntispamConfig? antispamConfig,
    bool? clientAntispamEnabled,
    String? clientAntispamReplace,
    V2NIMLocationInfo? locationInfo,
    String? notifyTargetTags,
    List<String>? receiverIds,
    })
    
    名称 类型 是否必填 默认值 说明
    messageConfig V2NIMChatroomMessageConfig - 聊天室消息相关配置。
    routeConfig NIMMessageRouteConfig - 消息事件抄送相关配置。
    antispamConfig NIMMessageAntispamConfig - 消息反垃圾相关配置,包括本地反垃圾或安全通配置,均需要在 网易云信控制台开通
    clientAntispamEnabled bool false 是否启用本地反垃圾。
  • 仅对文本消息生效
  • 如果开启本地发垃圾,发送消息时会进行本地反垃圾检测,完成后返回检测结果 NIMClientAntispamOperateType
    • 0:检测通过,可以发送该消息。
    • 1:发送替换后的文本消息。
    • 2:检测不通过,消息发送失败,返回本地错误码。
    • 3:消息发送后,由服务端拦截
  • clientAntispamReplace String clientAntispamEnabled 为 true 则必填 "" 反垃圾命中后替换的文本。
    receiverIds List<String> null 定向消息接收者账号列表,最多支持指定 100 个接收者。
    若该字段不为空,则表示该消息为聊天室定向消息,不在服务端进行存储
    notifyTargetTags String null 消息接收通知的标签,请参考 标签表达式
    locationInfo V2NIMLocationInfo null 消息空间位置信息配置。

    V2NIMSendChatroomMessageResult

    聊天室消息发送成功结果回包。

    DartV2NIMSendChatroomMessageResult({
    V2NIMChatroomMessage? message,
    String? antispamResult,
    NIMClientAntispamResult? clientAntispamResult,
    })
    
    名称 类型 是否只读 说明
    message V2NIMChatroomMessage 聊天室消息对象。
    antispamResult String 安全通反垃圾检测结果。
    clientAntispamResult NIMClientAntispamResult 本地反垃圾结果。

    V2NIMChatroomMessageListOption

    聊天室历史消息查询选项。

    DartV2NIMChatroomMessageListOption({
    V2NIMMessageQueryDirection direction = V2NIMMessageQueryDirection.V2NIM_QUERY_DIRECTION_DESC,
    List<NIMMessageType>? messageTypes,
    int? beginTime,
    int? limit,
    })
    
    名称 类型 是否必填 默认值 说明
    messageTypes List<NIMMessageType> null 消息类型,为 null 或空列表则表示查询所有消息类型。
    仅支持 0:文本,1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,11:Robot,100:自定义,其它为非法参数。
    beginTime int 0 查询开始时间(毫秒)。首次查询传 0,下一次查询传入上一次查询返回值中的 beginTime
    limit int 100 本次查询条数上限,取值范围为 [0,200]。传入小于 0 则默认为 100。
    direction V2NIMMessageQueryDirection V2NIM_QUERY_DIRECTION_DESC 时间降序 查询方向(查询结果方向):按照时间升序或降序。

    V2NIMChatroomTagMessageOption

    按标签查询聊天室消息选项。

    DartV2NIMChatroomTagMessageOption({
    List<String>? tags,
    List<NIMMessageType>? messageTypes,
    int? beginTime,
    int? endTime,
    int? limit,
    V2NIMMessageQueryDirection? direction,
    })
    
    名称 类型 是否必填 默认值 说明
    tags List<String> - 聊天室标签信息。如果为空或 size 为 0,则返回参数错误。
    messageTypes List<NIMMessageType> null 消息类型,为 null 或空列表则表示查询所有消息类型。
    beginTime int 0 查询开始时间。该字段必须小于等于 endTime
    endTime int 0 查询结束时间。该字段必须大于等于 beginTime,默认为系统当前时间。
    direction V2NIMMessageQueryDirection V2NIM_QUERY_DIRECTION_DESC 查询方向(查询结果方向):按照时间升序或降序。
    limit int 100 本次查询条数上限。必须大于 0,否则返回 191004 参数错误。

    V2NIMChatroomMemberQueryOption

    聊天室成员分页查询选项。

    DartV2NIMChatroomMemberQueryOption({
    List<V2NIMChatroomMemberRole>? memberRoles,
    bool? onlyBlocked,
    bool? onlyChatBanned,
    bool? onlyOnline,
    String? pageToken,
    int? limit,
    })
    
    名称 类型 是否必填 默认值 说明
    memberRoles List<V2NIMChatroomMemberRole> - 聊天室成员类型。如果不设置或为空则表示查询所有类型的成员。
    onlyBlocked bool false 是否只返回黑名单成员:
  • true:仅黑名单成员
  • false:全部成员。
  • onlyChatBanned bool false 是否只返回聊天禁言成员列表:
  • true:仅聊天禁言成员
  • false:全部成员。
  • onlyOnline bool false 是否只返回在线的固定成员(创建者、管理员、普通成员):
  • true:仅在线的固定成员
  • false:全部成员。
  • pageToken String "" 分页偏移,首次查询传空,下一次查询传入上一次查询返回值中的 nextToken
    limit int 100 单次查询聊天室成员最大数量。不建议超过 200,设置小于等于 0 则默认为 200。

    V2NIMChatroomMemberListResult

    聊天室成员查询结果。

    DartV2NIMChatroomMemberListResult({
    String? pageToken,
    bool finished = false,
    List<V2NIMChatroomMember>? memberList,
    })
    
    名称 类型 是否只读 说明
    pageToken String 分页偏移。
    finished bool 群成员是否全部获取:
  • true:已全部获取
  • false:未全部获取,可以继续获取。
  • memberList List<V2NIMChatroomMember> 分页获取的聊天室成员列表。

    V2NIMChatroomTagMemberOption

    按标签查询聊天室成员选项。

    DartV2NIMChatroomTagMemberOption({
    String? tag,
    String? pageToken,
    int? limit,
    })
    
    名称 类型 是否必填 默认值 说明
    tag String - 聊天室标签信息。
    pageToken String "" 分页偏移,首次查询传空,下一次查询传入上一次查询返回值中的 nextToken
    limit int 100 单次查询最大数量。必须大于 0,否则返回参数错误。

    V2NIMChatroomMemberRoleUpdateParams

    聊天室成员角色更新参数。

    DartV2NIMChatroomMemberRoleUpdateParams({
    V2NIMChatroomMemberRole? memberRole,
    int? memberLevel,
    String? notificationExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    memberRole V2NIMChatroomMemberRole - 聊天室成员角色类型:
  • 仅聊天室创建者有操作权限:将普通游客、普通成员设置为管理员或反之。
  • 聊天室管理员和创建者均有操作权限:将普通成员设置为普通游客或反之。
  • 不允许操作虚构用户和匿名游客,否则产生报错。
  • memberLevel int 0,表示未设置 聊天室成员等级,大于或等于 0 的整数。
    notificationExtension String null 聊天室成员角色变更通知的扩展字段。

    V2NIMChatroomTagTempChatBannedParams

    聊天室标签成员临时禁言参数。

    DartV2NIMChatroomTagTempChatBannedParams({
    String? targetTag,
    String? notifyTargetTags,
    int? duration,
    bool? notificationEnabled,
    String? notificationExtension,
    })
    
    名称 类型 是否必填 默认值 说明
    targetTag String - 被操作者标签。
    notifyTargetTags String - 操作后通知的标签,请参考 标签表达式
    duration int 0,表示取消临时禁言 临时禁言时长(秒)
    notificationEnabled bool true 操作后是否需要通知。
    notificationExtension String - 操作后通知的扩展字段。

    V2NIMChatroomSelfMemberUpdateParams

    聊天室成员更新本人信息参数。

    DartV2NIMChatroomSelfMemberUpdateParams({
    String? roomNick,
    String? roomAvatar,
    String? serverExtension,
    bool? notificationEnabled,
    String? notificationExtension,
    bool? persistence,
    })
    
    名称 类型 是否只读 默认值 说明
    roomNick String - 聊天室中显示昵称。设置为空表示不更新该字段,不可设置为 "",否则返回参数错误。
    roomAvatar String - 聊天室中显示头像。设置为空表示不更新该字段。
    serverExtension String - 聊天室成员服务端扩展字段,多端同步。建议 JSON 格式,长度上限为 2048。
    设置为空表示不更新该字段。
    notificationEnabled bool true 操作后是否需要通知。
    notificationExtension String - 操作后通知的扩展字段。
    persistence bool false 更新信息是否持久化,即是否将数据保存在本地数据库中。

    V2NIMChatroomUpdateParams

    聊天室信息更新参数。

    DartV2NIMChatroomUpdateParams({
    String? roomName,
    String? announcement,
    String? liveUrl,
    String? serverExtension,
    bool? notificationEnabled,
    String? notificationExtension,
    })
    
    名称 类型 是否必填 说明
    roomName String 聊天室名称。设置为空表示不更新该字段,不可设置为 "",否则返回参数错误。
    announcement String 聊天室公告。设置为空表示不更新该字段。
    liveUrl String 视频直播拉流地址。设置为空表示不更新该字段。
    serverExtension String 聊天室服务端扩展字段。必须为 JSON 格式封装,多端同步。长度限制与各套餐的配置(消息扩展字段上限调整)有关,具体请参考 字段限制说明
    设置为空表示不更新该字段。
    notificationEnabled bool 否,默认 true 操作后是否需要通知。
    notificationExtension String 聊天室信息变更通知的扩展字段。

    V2NIMChatroomLocationConfig

    聊天室空间坐标信息及订阅范围配置。

    DartV2NIMChatroomLocationConfig({
    double? distance,
    V2NIMLocationInfo? locationInfo,
    })
    
    名称 类型 是否必填 默认值 说明
    locationInfo V2NIMLocationInfo - 聊天室空间位置坐标信息。
    distance double - 基于空间位置订阅聊天室消息的距离。

    V2NIMChatroomTagsUpdateParams

    聊天室标签信息更新参数。

    DartV2NIMChatroomTagsUpdateParams({
    List<String>? tags,
    String? notifyTargetTags,
    bool? notificationEnabled,
    String? notificationExtension,
    })
    
    名称 类型 是否必填 说明
    tags List<String> 聊天室标签信息。
    设置为空表示不更新,设置为 [] 表示清空原有标签。
    notifyTargetTags String 操作后通知的标签信息,标签表达式请参考 聊天室标签管理
    设置为空表示不更新,设置为 "" 表示清空原有通知标签信息。
    notificationEnabled bool 否,默认 true 操作后是否需要通知。
    notificationExtension String 操作后通知的扩展字段。

    V2NIMConversationGroup

    云端会话分组对象。

    DartV2NIMConversationGroup({
        required String groupId,
        String? name,
        String? serverExtension,
        int? createTime,
        int? updateTime,
        })
    
    名称 类型 是否只读 说明
    groupId String 云端会话分组 ID。
    name String 云端会话分组名称。
    serverExtension String 云端会话服务端扩展字段。必须为 JSON 格式封装,长度上限为 1024 字节,多端同步。
    createTime int 云端会话分组创建时间戳(毫秒)。
    updateTime int 云端会话分组更新时间戳(毫秒)。

    V2NIMConversationGroupResult

    云端会话分组操作结果信息。

    DartV2NIMConversationGroupResult({
        List<V2NIMConversationOperationResult>? failedList,
        V2NIMConversationGroup? group,
        })
    
    名称 类型 是否只读 说明
    group V2NIMConversationGroup 云端会话分组。
    failedList List<V2NIMConversationOperationResult> 失败结果列表,包含操作失败的云端会话分组列表和错误信息。

    V2NIMConversationOperationResult

    单条云端会话操作结果信息。

    DartV2NIMConversationOperationResult({
        required String conversationId,
        NIMError? error,
        })
    
    名称 类型 是否只读 说明
    conversationId String 操作失败的会话 ID。如果操作成功则为空。组成方式:用户账号(accountId)| 会话类型(NIMConversationType)| 聊天对象账号(accountId)或群组 ID。
    error NIMError 操作失败的错误码和错误信息,如果操作成功,则为空。

    V2NIMChatroomQueueOfferParams

    新增或更新队列元素的配置参数。

    DartV2NIMChatroomQueueOfferParams({
    required String elementKey,
    required String elementValue,
    bool transient = false,
    String? elementOwnerAccountId,
    })
    
    名称 类型 是否必填 默认值 说明
    elementKey String - 队列元素的唯一 Key,长度限制为 128 字节。如果队列元素 Key 不存在,则追加到队尾,否则更新相应元素。
    elementValue String - 队列元素的值,长度限制为 4096 字节。
    transient bool false 队列元素是否瞬态。true:当前元素所属成员退出或掉线时,同步删除元素;false:当前元素所属成员退出或掉线时,仍保留元素。
    elementOwnerAccountId String - 队列元素所属账号,默认为当前操作者;管理员操作,可以指定元素属于的合法账号。

    V2NIMChatroomQueueElement

    聊天室队列元素信息。

    DartV2NIMChatroomQueueElement({
    String? key,
    String? value,
    String? accountId,
    String? nick,
    String? extension,
    })
    
    名称 类型 是否只读 默认值 说明
    key String - 队列元素的 Key。
    value String - 队列元素的值。
    accountId String - 该队列元素所属的账号。
    nick String - 该队列元素所属账号的昵称。
    extension String - 队列元素的扩展字段,JSON 格式。

    V2NIMChatroomNotificationAttachment

    聊天室通知消息附件对象,继承自 NIMMessageAttachment

    DartV2NIMChatroomNotificationAttachment({
    V2NIMChatroomMessageNotificationType? type,
    List<String>? tags,
    String? notificationExtension,
    List<String>? targetIds,
    String? operatorId,
    String? operatorNick,
    List<String>? targetNicks,
    String? targetTag,
    })
    
    名称 类型 是否必填 默认值 说明
    type V2NIMChatroomMessageNotificationType - 通知类型。
    targetIds List<String> null 被操作者账号(accountId)列表。
    targetNicks List<String> null 被操作者的昵称列表。
    targetTag String null 被操作者的标签。
    operatorId String null 操作者账号(accountId)。
    operatorNick String null 操作者的昵称。
    notificationExtension String null 操作后通知的扩展字段。
    tags List<String> null 操作后通知的通知的标签列表。

    V2NIMChatroomMessageRevokeNotificationAttachment

    聊天室撤回消息通知附件对象,继承自 V2NIMChatroomNotificationAttachment

    DartV2NIMChatroomMessageRevokeNotificationAttachment({
    String? messageClientId,
    int? messageTime,
    })
    
    名称 类型 是否必填 说明
    messageClientId String 撤回的消息客户端 ID。
    客户端生成的 UUID,不多端同步。
    messageTime int 消息撤回时间戳。

    V2NIMChatroomChatBannedNotificationAttachment

    聊天室禁言通知附件对象,继承自 V2NIMChatroomNotificationAttachment

    DartV2NIMChatroomChatBannedNotificationAttachment({
    bool? chatBanned,
    bool? tempChatBanned,
    int? tempChatBannedDuration,
    })
    
    名称 类型 是否必填 说明
    chatBanned bool 聊天室成员是否被禁言。
    tempChatBanned bool 聊天室成员是否被临时禁言。
    tempChatBannedDuration int 聊天室成员被临时禁言时长(毫秒)。0 表示已解除禁言。

    V2NIMChatroomMemberEnterNotificationAttachment

    成员进出聊天室通知附件对象,继承自 V2NIMChatroomNotificationAttachment

    DartV2NIMChatroomMemberEnterNotificationAttachment({
    int? tempChatBannedDuration,
    bool? chatBanned,
    bool? tempChatBanned,
    })
    
    名称 类型 是否必填 说明
    chatBanned bool 聊天室成员是否被禁言。
    管理员、普通成员、普通游客离开后再次进入聊天室时,保持之前设置的状态不变。
    tempChatBanned bool 聊天室成员是否被临时禁言。
    管理员、普通成员、普通游客离开后再次进入聊天室时,保持之前设置的状态不变。
    tempChatBannedDuration int 聊天室成员被禁言时长(毫秒)。
    成员离开后再次进入聊天室时,禁言时长不会重新计算。

    V2NIMChatroomMemberRoleUpdateAttachment

    聊天室成员角色变更通知附件对象,继承自 V2NIMChatroomNotificationAttachment

    DartV2NIMChatroomMemberRoleUpdateAttachment({
    V2NIMChatroomMemberRole? previousRole,
    V2NIMChatroomMember? currentMember,
    })
    
    名称 类型 是否必填 说明
    previousRole V2NIMChatroomMemberRole 变更前的角色类型。
    currentMember V2NIMChatroomMember 变更后的成员信息。

    V2NIMChatroomQueueNotificationAttachment

    聊天室队列元素变更通知附件对象,继承自 V2NIMChatroomNotificationAttachment

    DartV2NIMChatroomQueueNotificationAttachment({
    List<V2NIMChatroomQueueElement>? elements,
    V2NIMChatroomQueueChangeType? queueChangeType,
    })
    
    名称 类型 是否必填 默认值 说明
    elements List<V2NIMChatroomQueueElement> - 聊天室队列变更的内容。
  • 320:批量移除;
  • 324:多条批量添加;
  • 317:单个或多个队列元素 Key 变更。
  • queueChangeType V2NIMChatroomQueueChangeType - 聊天室队列更新类型。

    枚举

    NIMAIModelType

    数字人配置的 LLM(Large Language Models)模型类型。

    枚举类型 枚举值 说明
    nimAiModelTypeUKnown 0 未知。
    nimAiModelTypeQwen 1 阿里云通义千问大模型。
    nimAiModelTypeAzure 2 微软 Azure OpenAI。
    nimAiModelTypePrivate 3 网易云信定制私有化本地大模型。

    NIMAIModelRoleType

    数字人请求的 LLM 大模型的角色类型。

    枚举类型 枚举值 说明
    system system 系统。
    user user 用户。
    assistant assistant 助手。

    NIMMessageAIStatus

    数字人收发的消息的询问和应答标识。

    枚举类型 枚举值 说明
    unknow 0 表示未知消息。
    at 1 表示是一个艾特数字人的消息。
    response 2 表示是数字人响应艾特的消息。

    NIMLoginStatus

    登录状态。

    枚举类型 枚举值 说明
    loginStatusLogout 0 已登出。
    loginStatusLogined 1 已登录。
    loginStatusLogining 2 正在登录。
    loginStatusUnlogin 3 未登录。

    NIMLoginAuthType

    登录认证类型。

    枚举类型 枚举值 说明
    authTypeDefault 0 静态 Token 登录。
    authTypeDynamicToken 1 动态 Token 登录。
    authTypeThirdParty 2 通过第三方回调登录。

    NIMDataSyncLevel

    数据同步模式。

    枚举类型 枚举值 说明
    dataSyncLevelFull 0 全量同步。耗时较长,占用流量大,但数据展示时无需拉取。
    dataSyncLevelBasic 1 基础数据同步。耗时较短,占用流量小,但数据展示时需要先拉取数据。

    NIMLoginClientType

    当前处于登录状态的客户端类型。

    枚举类型 枚举值 说明
    loginClientTypeUnknown 0 未知类型
    loginClientTypeAndroid 1 Android
    loginClientTypeIOS 2 iOS
    loginClientTypePC 4 PC
    loginClientTypeWinPhone 8 Windows Phone
    loginClientTypeWeb 16 Web
    loginClientTypeRestful 32 服务端
    loginClientTypeMac 64 macOS
    loginClientTypeHarmony 65 鸿蒙

    NIMLoginClientChange

    客户端登录状态变更原因。

    枚举类型 枚举值 说明
    nimLoginClientChangeList 1 已登录客户端列表刷新。
    nimLoginClientChangeLogin 2 客户端登录。
    nimLoginClientChangeLogout 3 客户端登出。

    NIMKickedOfflineReason

    当前登录的客户端被踢下线的原因类型。

    枚举类型 枚举值 说明
    kickedOfflineReasonClientExclusive 1 被互斥的客户端踢下线。
    kickedOfflineReasonServer 2 被服务端踢下线。
    kickedOfflineReasonClient 3 被其他客户端手动踢下线。

    NIMConnectStatus

    SDK 连接状态。您可以根据不同的状态进行界面提示相应的业务操作。

    枚举类型 枚举值 说明
    NIMConnectStatus 0 SDK 未连接服务端。
    nimConnectStatusConnected 1 SDK 已连接服务端。
    nimConnectStatusConnecting 2 SDK 正在与服务端连接。
    nimConnectStatusWaiting 3 SDK 正在等待与服务端重连。

    NIMDataSyncType

    数据同步类型:

    • 主数据:离线消息,漫游消息,用户信息,群信息,超大群信息等。
    • 群成员:高级群群成员。
    • 超大群成员:超大群群成员。
    枚举类型 枚举值 说明
    nimDataSyncUnknown 0 不在任何同步进程中。
    nimDataSyncMain 1 同步主数据。
    nimDataSyncTeamMember 2 同步群成员。
    nimDataSyncSuperTeamMember 3 同步超大群成员。

    NIMDataSyncState

    数据同步状态。

    枚举类型 枚举值 说明
    nimDataSyncStateWaiting 1 等待数据同步。
    nimDataSyncStateInSyncing 2 开始数据同步。
    nimDataSyncStateCompleted 3 数据同步完成。

    NIMConversationType

    会话类型。

    枚举类型 枚举值 说明
    unknown 0 未知类型。
    p2p 1 单聊(点对点)会话。
    team 2 高级群会话。
    superTeam 3 超大群会话。

    NIMLastMessageState

    会话最后一条消息的状态。

    枚举类型 枚举值 说明
    defaultState 0 默认状态。
    revoke 1 撤回状态。
    clientFill 2 客户端回填。

    NIMMessageType

    消息类型。

    枚举类型 枚举值 说明
    invalid -1 未知/不合法类型。
    text 0 文本。
    image 1 图片。
    audio 2 语音。
    video 3 视频。
    location 4 地理位置。
    notification 5 通知。
    file 6 文件。
    avChat 7 音视频通话。
    tip 10 提示。
    robot 11 机器人。
    call 12 话单。
    custom 100 自定义。

    NIMMessageAttachmentUploadState

    消息附件上传状态。

    枚举类型 枚举值 说明
    unknown 0 未知/不存在不需要上传。
    succeed 1 上传成功。
    failed 2 上传失败。
    uploading 3 正在上传。

    NIMMessageNotificationType

    通知消息类型。

    枚举类型 枚举值 说明
    teamInvite 0 邀请成员入高级群。
    teamKick 1 高级群成员被踢出。
    teamLeave 2 高级群成员退群。
    teamUpdateTInfo 3 高级群信息更新。
    teamDismiss 4 高级群被解散。
    teamApplyPass 5 进高级群申请通过。
    teamOwnerTransfer 6 高级群主身份转移。
    teamAddManager 7 添加高级群管理员。
    teamRemoveManager 8 移除高级群管理员。
    teamInviteAccept 9 接受邀请进高级群。
    teamBannedTeamMember 10 禁言高级群成员。
    superTeamInvite 401 超大群拉人。
    superTeamKick 402 超大群踢人。
    superTeamLeave 403 退出超大群。
    superTeamUpdateTinfo 404 更新超大群信息。
    superTeamDismiss 405 超大群解散。
    superTeamOwnerTransfer 406 移交超大群主。
    superTeamAddManager 407 添加超大群管理员。
    superTeamRemoveManager 408 移除超大群管理员。
    superTeamBannedTeamMember 409 禁言超大群成员。
    superTeamApplyPass 410 超大群申请加入通过。
    superTeamInviteAccept 411 接受邀请进超大群。

    NIMMessageSendingState

    消息发送状态。

    枚举类型 枚举值 说明
    unknown 0 未知状态。
    succeeded 1 消息发送成功。
    failed 2 消息发送失败。
    sending 3 消息正在发送。

    NIMClientAntispamOperateType

    客户端本地反垃圾命中后的操作类型。

    枚举类型 枚举值 说明
    none 0 无操作。
    replace 1 本地替换。
    clientShield 2 本地屏蔽。该文本消息无法发送。
    serverShield 3 服务端屏蔽。该文本消息发送后由服务器屏蔽。

    NIMQueryDirection

    查询方向。

    枚举类型 枚举值 说明
    desc 0 按时间戳降序查询。
    asc 1 按时间戳升序查询。

    NIMMessageRevokeType

    消息撤回类型。

    枚举类型 枚举值 说明
    undefined 0 未定义。
    p2pBothway 1 单聊消息双向撤回,消息双方均收到撤回通知并清除消息。
    teamBothway 2 群消息双向撤回,消息双方均收到撤回通知并清除消息。
    superTeamBothway 3 超大群消息双向撤回,消息双方均收到撤回通知并清除消息。
    p2pOneway 4 单聊消息单向撤回,发送方无感知,接收方收到撤回通知并清除消息。
    teamOneway 5 群消息单向撤回,发送方无感知,接收方收到撤回通知并清除消息。

    NIMMessagePinState

    Pin 消息的状态。

    枚举类型 枚举值 说明
    notPinned 0 未被 Pin。
    pinned 1 已被 Pin。
    updated 2 状态更新。

    NIMMessageQuickCommentType

    快捷评论操作类型。

    枚举类型 枚举值 说明
    add 1 添加快捷评论。
    remove 2 移除快捷评论。

    NIMSortOrder

    排序规则。

    枚举类型 枚举值 说明
    sortOrderDesc 0 按时间戳降序排序。
    sortOrderAsc 1 按时间戳升序排序。

    NIMTeamType

    群组类型。

    枚举类型 枚举值 说明
    typeInvalid 0 无效类型。
    typeNormal 1 高级群。
    typeSuper 2 超大群。

    NIMTeamJoinMode

    入群验证模式。

    枚举类型 枚举值 说明
    joinModeFree 0 自由加入群组,无须验证。
    joinModeApply 1 需群主或管理员同意后加入群组。
    joinModeInvite 2 私有群,不接受申请,仅能通过邀请方式入群。

    NIMTeamAgreeMode

    被邀请人同意模式。

    枚举类型 枚举值 说明
    agreeModeAuth 0 需要被邀请人同意。
    agreeModeNoAuth 1 不需要被邀请人同意。

    NIMTeamInviteMode

    被邀请人同意模式。

    枚举类型 枚举值 说明
    inviteModeManager 0 仅群主或管理员可以邀请其他人入群。
    inviteModeAll 1 所有群成员都可以邀请其他人入群。

    NIMTeamUpdateInfoMode

    群组资料修改模式。

    枚举类型 枚举值 说明
    updateInfoModeManager 0 仅群主或管理员可以修改群组资料。
    updateInfoModeAll 1 所有群成员都可以修改群组资料。

    NIMTeamChatBannedMode

    群组禁言状态。

    枚举类型 枚举值 说明
    chatBannedModeNone 0 不禁言。
    chatBannedModeBannedNormal 1 普通成员禁言,不包括群主和管理员。
    chatBannedModeBannedAll 2 全员禁言,包括群主和管理员。全员禁言仅能由服务端 API 发起。

    NIMTeamUpdateExtensionMode

    群组扩展字段修改模式。

    枚举类型 枚举值 说明
    updateExtensionModeManager 0 仅群主或管理员可以修改群组扩展字段。
    updateExtensionModeAll 1 所有群成员都可以修改群组扩展字段。

    NIMTeamMemberRole

    群成员角色类型。

    枚举类型 枚举值 说明
    memberRoleNormal 0 普通成员。
    memberRoleOwner 1 群主。
    memberRoleManager 2 群管理员。

    NIMTeamMemberRoleQueryType

    群成员角色查询类型。

    枚举类型 枚举值 说明
    memberRoleQueryTypeAll 0 所有成员。
    memberRoleQueryTypeManager 1 群主和群管理员。
    memberRoleQueryTypeNormal 2 普通成员。

    NIMTeamJoinActionType

    群成员入群操作类型。

    枚举类型 枚举值 说明
    joinActionTypeApplication 0 (管理员身份)收到其他成员入群申请。
    joinActionTypeRejectApplication 1 收到管理员拒绝入群申请。
    joinActionTypeInvitation 2 收到入群邀请。
    joinActionTypeRejectInvitation 3 (邀请人)收到被邀请人拒绝入群邀请。

    NIMTeamJoinActionStatus

    群成员入群操作处理状态。

    枚举类型 枚举值 说明
    joinActionStatusInit 0 未处理。
    joinActionStatusAgreed 1 已同意。
    joinActionStatusRejected 2 已拒绝。
    joinActionStatusExpired 3 已过期。

    NIMP2PMessageMuteMode

    单聊(点对点)消息免打扰模式。

    枚举类型 枚举值 说明
    p2pMessageMuteModeOff 0 单聊消息免打扰关闭。
    p2pMessageMuteModeOn 1 单聊消息免打扰开启。

    NIMTeamMessageMuteMode

    群消息免打扰模式。

    枚举类型 枚举值 说明
    teamMessageMuteModeOff 0 群消息免打扰关闭。
    teamMessageMuteModeOn 1 群消息免打扰开启。
    teamMessageMuteModeManagerOff 2 普通成员群消息免打扰开启。

    NIMFriendAddMode

    添加好友模式。

    枚举类型 枚举值 说明
    nimFriendModeTypeAdd 1 直接添加对方为好友,无需对方验证。
    nimFriendModeTypeApply 2 请求添加对方为好友,需要对方验证通过。

    NIMFriendAddApplicationStatus

    申请添加好友相关操作状态。

    枚举类型 枚举值 说明
    nimFriendAddApplicationStatusInit 0 未处理。
    nimFriendAddApplicationStatusAgreed 1 已同意。
    nimFriendAddApplicationStatusRejected 2 已拒绝。
    nimFriendAddApplicationStatusExpired 3 已过期。
    nimFriendAddApplicationStatusDirectAdd 4 直接添加为好友。

    NIMFriendDeletionType

    好友删除的类型。

    枚举类型 枚举值 说明
    nimFriendDeletionTypeBySelf 1 自己删除好友。
    nimFriendDeletionTypeByFriend 2 对方删除好友。

    NIMDownloadAttachmentType

    下载附件的类型。

    枚举类型 枚举值 说明
    nimDownloadAttachmentTypeSource 0 原始资源,支持全部有附件的类型。
    nimDownloadAttachmentTypeThumbnail 1 图片缩略图,仅支持图片类附件。
    nimDownloadAttachmentTypeVideoCover 2 视频封面,仅支持视频类附件。

    NIMClientType

    客户端端类型。

    枚举类型 枚举值 说明
    unknown 0 未知
    android 1 Android
    ios 2 iOS
    windows 4 Windows
    macos 4 macOS
    wp 8 Windows Phone
    web 16 Web
    rest 32 RESTFUL

    NIMNotificationFoldStyle

    通知折叠方式。

    枚举类型 枚举值 说明
    all 0 折叠所有通知栏消息为一条通知。
    expand 1 不折叠通知栏消息。
    contact 2 将同一个会话下的消息折叠为一条通知,不同会话之间不折叠。

    NIMNotificationExtraType

    通知传递的 extra 类型。

    枚举类型 枚举值 说明
    message 0 传递消息对象。
    jsonArrStr 1 将消息转为 JsonArray 的字符串格式。

    V2NIMChatroomQueueLevelMode

    聊天室队列操作权限模式。

    枚举类型 枚举值 说明
    V2NIM_CHATROOM_QUEUE_LEVEL_MODE_ANY 0 聊天室中所有人都有权限操作。
    V2NIM_CHATROOM_QUEUE_LEVEL_MODE_MANAGER 1 只有聊天室创建者/管理员才能操作。

    V2NIMChatroomKickedReason

    聊天室被踢原因。

    枚举类型 枚举值 说明
    V2NIM_CHATROOM_KICKED_REASON_UNKNOWN -1 未知。
    V2NIM_CHATROOM_KICKED_REASON_CHATROOM_INVALID 1 聊天室解散。
    V2NIM_CHATROOM_KICKED_REASON_BY_MANAGER 2 被管理员踢出。
    V2NIM_CHATROOM_KICKED_REASON_BY_CONFLICT_LOGIN 3 多端被踢。
    V2NIM_CHATROOM_KICKED_REASON_SILENTLY 4 静默被踢。
    表示连接聊天室的 link 已作废,客户端不做重连(只有 Web 端才会有此场景)。
    V2NIM_CHATROOM_KICKED_REASON_BE_BLOCKED 5 被拉入黑名单被踢。

    V2NIMChatroomStatus

    聊天室状态。

    枚举类型 枚举值 说明
    V2NIM_CHATROOM_STATUS_DISCONNECTED 0 聊天室断开连接。
    V2NIM_CHATROOM_STATUS_WAITING 1 聊天室等待重连。
    V2NIM_CHATROOM_STATUS_CONNECTING 2 聊天室连接过程中。
    V2NIM_CHATROOM_STATUS_CONNECTED 3 聊天室已连接。
    V2NIM_CHATROOM_STATUS_ENTERING 4 正在进入聊天室。
    V2NIM_CHATROOM_STATUS_ENTERED 5 已进入聊天室。
    V2NIM_CHATROOM_STATUS_EXITED 6 已退出聊天室。

    V2NIMChatroomMemberRole

    聊天室成员角色。

    • 固定成员:创建者、管理员、普通成员。总计上限 1000 人。
    • 游客:普通游客、匿名游客。无人数上限。
    • 虚构成员:虚构用户。仅支持通过服务端 API 添加聊天室虚构用户
    枚举类型 枚举值 说明
    V2NIM_CHATROOM_MEMBER_ROLE_NORMAL 0 普通成员。
    V2NIM_CHATROOM_MEMBER_ROLE_CREATOR 1 创建者。
    V2NIM_CHATROOM_MEMBER_ROLE_MANAGER 2 管理员。
    V2NIM_CHATROOM_MEMBER_ROLE_NORMAL_GUEST 3 普通游客。
    V2NIM_CHATROOM_MEMBER_ROLE_ANONYMOUS_GUEST 4 匿名游客。
    V2NIM_CHATROOM_MEMBER_ROLE_VIRTUAL 5 虚构用户。

    V2NIMMessageQueryDirection

    消息查询方向。

    枚举类型 枚举值 说明
    V2NIM_QUERY_DIRECTION_DESC 0 按时间戳降序查询。
    V2NIM_QUERY_DIRECTION_ASC 1 按时间戳升序查询。

    V2NIMChatroomQueueChangeType

    聊天室队列通知消息类型。

    枚举类型 枚举值 说明
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_UNKNOWN 0 未知。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_OFFER 1 新增队列元素。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_POLL 2 移除队列元素。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_DROP 3 清空所有元素。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_PARTCLEAR 4 清理部分元素。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_BATCH_UPDATE 5 批量更新元素。
    V2NIM_CHATROOM_QUEUE_CHANGE_TYPE_BATCH_OFFER 6 批量添加元素。

    V2NIMChatroomMessageNotificationType

    聊天室通知类消息类型。

    枚举类型 枚举值 说明
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_ENTER 0 成员进入聊天室。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_EXIT 1 成员退出聊天室。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_BLOCK_ADDED 2 聊天室成员被加入黑名单。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_BLOCK_REMOVED 3 聊天室成员被移除黑名单。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_CHAT_BANNED_ADDED 4 聊天室成员被禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_CHAT_BANNED_REMOVED 5 聊天室成员被取消禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_ROOM_INFO_UPDATED 6 聊天室信息更新。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_KICKED 7 聊天室成员被踢。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_TEMP_CHAT_BANNED_ADDED 8 聊天室成员被临时禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_TEMP_CHAT_BANNED_REMOVED 9 聊天室成员被解除临时禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MEMBER_INFO_UPDATED 10 聊天室成员信息更新(nick/avatar/extension)
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_QUEUE_CHANGE 11 聊天室队列变更。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_CHAT_BANNED 12 聊天室处于禁言状态。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_CHAT_BANNED_REMOVED 13 聊天室处于非禁言状态。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_TAG_TEMP_CHAT_BANNED_ADDED 14 聊天室标签成员被临时禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_TAG_TEMP_CHAT_BANNED_REMOVED 15 聊天室标签成员被解除临时禁言。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_MESSAGE_REVOKE 16 聊天室消息撤回。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_TAGS_UPDATE 17 聊天室标签更新。
    V2NIM_CHATROOM_MESSAGE_NOTIFICATION_TYPE_ROLE_UPDATE 18 聊天室成员角色更新。

    NIMSearchKeywordMatchType

    搜索关键字匹配条件。

    枚举类型 枚举值 说明
    V2NIM_SEARCH_KEYWORD_MATH_TYPE_OR 0 或关系。
    V2NIM_SEARCH_KEYWORD_MATH_TYPE_ADD 1 与关系。

    NIMClearHistoryMode

    清理历史消息模式。

    枚举类型 枚举值 说明
    V2NIM_CLEAR_HISTORY_MODE_ALL 0 同时删除云端和本地的历史消息。
    V2NIM_CLEAR_HISTORY_MODE_LOCAL 1 仅删除本地的历史消息。(云端拉取可以恢复。)
    V2NIM_CLEAR_HISTORY_MODE_LOCAL_IRREPARABLY 2 仅删除本地,云端拉取也不可恢复。
    状态记录在本地,卸载重装后,数据会重新出现。

    V2NIMMessageAIStreamStatus

    数字人流式消息状态。

    枚举类型 枚举值 说明
    V2NIM_MESSAGE_AI_STREAM_STATUS_STREAMING -1 流式过程中(本地状态,其他为服务器状态)。
    V2NIM_MESSAGE_AI_STREAM_STATUS_NONE 0 非流式状态。
    V2NIM_MESSAGE_AI_STREAM_STATUS_PLACEHOLDER 1 占位。
    V2NIM_MESSAGE_AI_STREAM_STATUS_STOPPED 2 停止输出。
    V2NIM_MESSAGE_AI_STREAM_STATUS_UPDATED 3 停止并更新。
    V2NIM_MESSAGE_AI_STREAM_STATUS_GENERATED 4 输出完成。
    V2NIM_MESSAGE_AI_STREAM_STATUS_ABORTED 5 服务器异常终止。

    V2NIMMessageAIStreamStopOpType

    停止流式输出操作类型。

    枚举类型 枚举值 说明
    V2NIM_MESSAGE_AI_STREAM_STOP_OP_DEFAULT 0 停止输出保持现状。
    V2NIM_MESSAGE_AI_STREAM_STOP_OP_REVOKE 1 停止并撤回消息。
    V2NIM_MESSAGE_AI_STREAM_STOP_OP_UPDATE 2 停止并更新消息内容。

    V2NIMMessageAIRegenOpType

    重新输出数字人消息操作类型。

    枚举类型 枚举值 说明
    V2NIM_MESSAGE_AI_REGEN_OP_UPDATE 1 更新消息(不会生成新消息)。
    V2NIM_MESSAGE_AI_REGEN_OP_NEW 2 生成一条新消息。

    V2NIMAIModelStreamCallStatus

    数字人流式消息请求状态。

    枚举类型 枚举值 说明
    V2NIM_AI_MODEL_STREAM_CALL_STATUS_NONE 0 非流式状态。
    V2NIM_AI_MODEL_STREAM_CALL_STATUS_STOPPED 2 停止输出。
    V2NIM_AI_MODEL_STREAM_CALL_STATUS_GENERATED 4 输出完成。
    V2NIM_AI_MODEL_STREAM_CALL_STATUS_ABORTED 5 服务器异常终止。

    NIMSearchDirection

    消息检索方向。

    枚举类型 枚举值 说明
    V2NIM_SEARCH_DIRECTION_BACKWARD 0 表示时间从新到老查询。
    V2NIM_SEARCH_DIRECTION_FORWARD 1 表示时间从老到新查询。

    NIMSearchStrategy

    消息检索策略。

    枚举类型 枚举值 说明
    V2NIM_SEARCH_STRATEGY_SQL_LIKE 0 表示基于SQL模糊查询(LIKE)。
    数据量大的情况下,该模式检索耗时长。
    V2NIM_SEARCH_STRATEGY_FTS 1 表示基于全文检索(FULL_TEXT_SEARCH)。

    监听

    登录相关监听器

    dartStream<NIMLoginStatus> get onLoginStatus => _platform.onLoginStatus;
    Stream<NIMError> get onLoginFailed => _platform.onLoginFailed;
    Stream<NIMKickedOfflineDetail> get onKickedOffline =>
        _platform.onKickedOffline;
    Stream<NIMLoginClientChangeEvent> get onLoginClientChanged =>
        _platform.onLoginClientChanged;
    Stream<NIMConnectStatus> get onConnectStatus => _platform.onConnectStatus;
    Stream<NIMError> get onDisconnected => _platform.onDisconnected;
    Stream<NIMError> get onConnectFailed => _platform.onConnectFailed;
    Stream<NIMDataSyncDetail> get onDataSync => _platform.onDataSync;
    

    回调事件

    • onLoginStatus

      登录状态变化回调。

      参数名称 类型 说明
      status NIMLoginStatus 登录状态
    • onLoginFailed

      登录失败回调。

      参数名称 类型 说明
      error NIMError 登录失败错误码及错误信息
    • onKickedOffline

      客户端被踢回调。

      参数名称 类型 说明
      detail NIMKickedOfflineDetail 客户端被踢详细信息
    • onLoginClientChanged

      多端登录时,其他在线客户端登录状态变化回调。

      参数名称 类型 说明
      change NIMLoginClientChange 其他客户端登录状态变更原因
      clients List<NIMLoginClient> 其他客户端登录状态变更具体信息
    • onConnectStatus

      登录连接状态变化回调。

      参数名称 类型 说明
      status NIMConnectStatus 登录连接状态
    • onDisconnected

      登录连接断开回调。

      参数名称 类型 说明
      error NIMError 登录连接断开错误码及错误信息
    • onConnectFailed

      登录连接失败回调。

      参数名称 类型 说明
      error NIMError 登录连接失败错误码及错误信息
    • onDataSync

      数据同步状态变化回调。

      参数名称 类型 说明
      type NIMDataSyncType 数据同步类型
      state NIMDataSyncState 数据同步状态
      error NIMError 数据同步失败错误码及错误信息

    会话相关监听器

    dartStream<void> get onSyncStarted => _platform.onSyncStarted;
    Stream<void> get onSyncFinished => _platform.onSyncFinished;
    Stream<void> get onSyncFailed => _platform.onSyncFailed;
    Stream<NIMConversation> get onConversationCreated =>
        _platform.onConversationCreated;
    Stream<List<String>> get onConversationDeleted =>
        _platform.onConversationDeleted;
    Stream<List<NIMConversation>> get onConversationChanged =>
        _platform.onConversationChanged;
    Stream<int> get onTotalUnreadCountChanged =>
        _platform.onTotalUnreadCountChanged;
    Stream<UnreadChangeFilterResult> get onUnreadCountChangedByFilter =>
        _platform.onUnreadCountChangedByFilter;
    Stream<ReadTimeUpdateResult> get onConversationReadTimeUpdated =>
        _platform.onConversationReadTimeUpdated;
    

    回调事件

    • onSyncStarted

      会话数据同步开始回调。

    • onSyncFinished

      会话数据同步结束回调。

      请在收到该回调之后进行会话相关操作,否则可能导致会话数据不完整。

    • onSyncFailed

      会话数据同步失败回调。

      如果在收到该回调之后进行会话相关操作,会话数据可能不完整。

      参数名称 类型 说明
      error NIMError 会话数据同步失败错误码及错误信息
    • onConversationCreated

      会话成功创建回调。
      当本地端或多端同步创建会话成功时会触发该回调。

      参数名称 类型 说明
      conversation NIMConversation 创建的会话对象。
    • onConversationDeleted

      主动删除会话回调。
      当本地端或多端同步删除会话成功时会触发该回调。

      参数名称 类型 说明
      conversation NIMConversation 删除的会话对象。
    • onConversationChanged

      会话变更回调。
      当本地端或多端同步置顶会话、设置会话免打扰、会话有新消息、主动更新会话成功时会触发该回调。

      参数名称 类型 说明
      conversationList List<NIMConversation> 变更的会话对象列表
    • onTotalUnreadCountChanged

      会话消息总未读数变更回调。

      参数名称 类型 说明
      unreadCount int 变更后的会话消息总未读数
    • onUnreadCountChangedByFilter

      会话过滤后的未读数变更回调。
      调用 subscribeUnreadCountByFilter 订阅监听后,当会话过滤后的未读数变化时会返回该回调。

      参数名称 类型 说明
      filter NIMConversationFilter 会话过滤对象
      unreadCount int 会话过滤后的消息未读数
    • onConversationReadTimeUpdated

      同一账号多端登录后的会话已读时间戳标记的回调。

      当某一账号分别登录设备 A 和 B,A 的会话已读时间戳标记会同步到 B。

      参数名称 类型 说明
      conversationId String 同步标记的会话 ID
      readTime int 标记的时间戳

    会话分组相关监听器

    dartStream<V2NIMConversationGroup> get onConversationGroupCreated =>
        _platform.onConversationGroupCreated;
    Stream<String> get onConversationGroupDeleted =>
        _platform.onConversationGroupDeleted;
    Stream<V2NIMConversationGroup> get onConversationGroupChanged =>
        _platform.onConversationGroupChanged;
    Stream<ConversationsAddedEvent> get onConversationsAddedToGroup =>
        _platform.onConversationsAddedToGroup;
    Stream<ConversationsRemovedEvent> get onConversationsRemovedFromGroup =>
        _platform.onConversationsRemovedFromGroup;
    

    回调事件

    • onConversationGroupCreated

      云端会话分组成功创建回调。 当本地端或多端同步创建云端会话分组成功时会触发该回调。

      参数名称 类型 说明
      conversationGroup V2NIMConversationGroup 创建的云端会话分组对象
    • onConversationGroupDeleted

      删除云端会话分组回调。 当本地端或多端同步删除云端会话分组成功时会触发该回调。

      参数名称 类型 说明
      groupId String 删除的会话分组 ID
    • onConversationGroupChanged

      云端会话分组变更回调。 当本地端或多端同步更新云端会话分组成功时会触发该回调。

      参数名称 类型 说明
      conversationGroup V2NIMConversationGroup 变更的云端会话分组对象
    • onConversationsAddedToGroup

      添加云端会话到云端会话分组回调。 当本地端或多端同步添加会话到分组成功时会触发该回调。

      参数名称 类型 说明
      groupId String 云端会话分组 ID
      conversations List<V2NIMConversation> 添加到分组的云端会话对象列表
    • onConversationsRemovedFromGroup

      将云端会话从云端会话分组移除回调。 当本地端或多端同步移除云端会话成功时会触发该回调。

      参数名称 类型 说明
      groupId String 云端会话分组 ID
      conversationIds List<String> 移除的云端会话 ID 列表

    消息相关监听器

    dartStream<NIMMessage> get onSendMessage =>
        MessageServicePlatform.instance.onSendMessage.stream;
    Stream<List<NIMMessage>> get onReceiveMessages =>
        MessageServicePlatform.instance.onReceiveMessages.stream;
    Stream<List<NIMP2PMessageReadReceipt>> get onReceiveP2PMessageReadReceipts =>
        MessageServicePlatform.instance.onReceiveP2PMessageReadReceipts.stream;
    Stream<List<NIMTeamMessageReadReceipt>>
        get onReceiveTeamMessageReadReceipts => MessageServicePlatform
            .instance.onReceiveTeamMessageReadReceipts.stream;
    Stream<List<NIMMessageRevokeNotification>> get onMessageRevokeNotifications =>
        MessageServicePlatform.instance.onMessageRevokeNotifications.stream;
    Stream<NIMMessageQuickCommentNotification>
        get onMessageQuickCommentNotification => MessageServicePlatform
            .instance.onMessageQuickCommentNotification.stream;
    Stream<NIMMessagePinNotification> get onMessagePinNotification =>
        MessageServicePlatform.instance.onMessagePinNotification.stream;
    Stream<List<NIMMessageDeletedNotification>>
        get onMessageDeletedNotifications =>
            MessageServicePlatform.instance.onMessageDeletedNotifications.stream;
    Stream<List<NIMClearHistoryNotification>> get onClearHistoryNotifications =>
        MessageServicePlatform.instance.onClearHistoryNotifications.stream;
    Stream<NIMSendMessageProgress> get onSendMessageProgress =>
        MessageServicePlatform.instance.onSendMessageProgress.stream;
    Stream<List<NIMMessage>> get onReceiveMessagesModified =>
        MessageServicePlatform.instance.onReceiveMessagesModified.stream;
    

    回调事件

    • onSendMessage

      本端发送消息状态回调,本端发送消息或插入消息成功后,SDK 会返回该回调。

      参数名称 类型 说明
      message NIMMessage 发送或插入的消息
    • onReceiveMessages

      消息接收回调,本端接收到发送方消息,或其他端同步的消息时会触发该回调。

      参数名称 类型 说明
      messages List<NIMMessage> 消息列表
    • onReceiveMessagesModified

      消息更新回调,本端更新消息成功后,会话参与者以及登录的其他客户端会收到该回调通知(包括更新消息在线同步通知、更新消息多端同步通知以及更新消息漫游通知)。

      参数名称 类型 说明
      messages List<NIMMessage> 更新后的消息列表
    • onReceiveP2PMessageReadReceipts

      单聊消息已读回调。

      本端发送已读回执成功后,其他登录客户端和消息发送方均会收到该回调。

      参数名称 类型 说明
      readReceipts List<NIMP2PMessageReadReceipt> 单聊消息已读回执列表
    • onReceiveTeamMessageReadReceipts

      高级群消息已读回调。 本端发送已读回执成功后,其他登录客户端和消息发送方均会收到该回调。

      参数名称 类型 说明
      readReceipts List<NIMTeamMessageReadReceipt> 高级群消息已读回执列表
    • onMessageRevokeNotifications

      消息撤回通知回调。 本地端或多端同步撤回消息成功后,SDK 会返回该回调。

      参数名称 类型 说明
      readReceipts List<NIMMessageRevokeNotification> 消息撤回通知列表
    • onMessageQuickCommentNotification

      消息快捷评论操作通知回调。 本地端或多端同步添加或移除消息快捷评论成功后,消息发送方和消息接收方均会收到该回调。

      参数名称 类型 说明
      quickCommentNotification NIMMessageQuickCommentNotification 快捷评论通知列表
    • onMessagePinNotification

      Pin 消息状态变化通知回调。 本地端或多端同步 Pin 消息成功后,消息发送方和消息接收方均会收到该回调。

      参数名称 类型 说明
      pinNotification NIMMessagePinNotification Pin 消息状态变化通知列表
    • onMessageDeletedNotifications

      消息被删除回调。 本地端或多端同步删除消息成功后,SDK 会返回该回调。

      参数名称 类型 说明
      messageDeletedNotifications List<NIMMessageDeletedNotification> 消息删除通知列表
    • onClearHistoryNotifications

      会话历史消息清除回调。 本地端或多端同步清空会话内历史消息成功后,SDK 会返回该回调。

      参数名称 类型 说明
      clearHistoryNotifications List<NIMClearHistoryNotification> 会话历史消息清除通知列表
    • onSendMessageProgress

      发送消息进度回调。 本端发送消息后,SDK 会返回消息的发送进度回调。

      参数名称 类型 说明
      progress NIMSendMessageProgress 消息发送进度

    AI 透传相关监听器

    dartStream<NIMAIModelCallResult> get onProxyAIModelCall =>
        _platform.onProxyAIModelCall;
    Stream<NIMAIModelStreamCallResult> get onProxyAIModelStreamCall;
        _platform.onProxyAIModelStreamCall;
    

    回调事件

    接口 proxyAIModelCall 调用完毕后,服务端响应以通知的形式下发,客户端需要触发回调提供响应。

    • onProxyAIModelCall:AI 透传接口的响应的回调。
    参数名称 类型 说明
    data NIMAIModelCallResult 本次响应的结构体。
    • onProxyAIModelStreamCall:AI 透传接口的流式响应的回调。
    参数名称 类型 说明
    data NIMAIModelStreamCallResult 本次响应的结构体。

    用户资料相关监听器

    dartStream<List<NIMUserInfo>> get onUserProfileChanged =>
        UserServicePlatform.instance.onUserProfileChanged.stream;
    Stream<NIMUserInfo> onBlockListAdded =
        UserServicePlatform.instance.onBlockListAdded.stream;
    Stream<String> onBlockListRemoved =
        UserServicePlatform.instance.onBlockListRemoved.stream;
    

    成员函数

    • onUserProfileChanged

      用户资料变更回调。

      参数名称 类型 说明
      users List<NIMUserInfo> 用户资料
    • onBlockListAdded

      黑名单新增用户回调。

      当客户端本端添加用户到黑名单,或者其他端同步添加用户到黑名单时触发该回调。

      参数名称 类型 说明
      user NIMUserInfo 添加进黑名单的用户资料
    • onBlockListRemoved

      黑名单移除用户回调。

      当客户端本端从黑名单移除用户,或者其他端同步从黑名单移除用户时触发该回调。

      参数名称 类型 说明
      accountId String 移出黑名单的用户账号 ID

    好友信息相关监听器

    dartStream<NIMFriend> get onFriendAdded => _platform.onFriendAdded;
    Stream<NIMFriendDeletion> get onFriendDeleted => _platform.onFriendDeleted;
    Stream<NIMFriendAddApplication> get onFriendAddApplication =>
        _platform.onFriendAddApplication;
    Stream<NIMFriendAddApplication> get onFriendAddRejected =>
        _platform.onFriendAddRejected;
    Stream<NIMFriend> get onFriendInfoChanged => _platform.onFriendInfoChanged;
    

    成员函数

    • onFriendAdded

      添加好友成功的回调。

      当客户端本端或其他端同步添加好友成功时会触发该回调。

      参数名称 类型 是否必填 是否只读 说明
      friendInfo NIMFriend 添加成功的好友信息
    • onFriendDeleted

      删除好友回调。

      • 当客户端本端或其他端同步删除好友时会触发该回调。
      • 被对方删除好友时会触发该回调。
      参数名称 类型 是否必填 是否只读 说明
      deletionType NIMFriendDeletionType 删除好友的类型
      accountId String 账号 ID
    • deletionType=1(本端或其他端同步删除好友),则该字段为被删除的好友账号 ID
    • deletionType=2(被对方删除好友),则该字段为删除您的好友账号 ID
    • onFriendAddApplication

      请求好友添加申请的回调。

      参数名称 类型 是否必填 是否只读 说明
      application NIMFriendAddApplication 申请添加好友的信息
    • onFriendAddRejected

      被对方拒绝好友添加申请的回调。

      参数名称 类型 是否必填 是否只读 说明
      rejection NIMFriendAddApplication 被对方拒绝好友添加申请的信息
    • onFriendInfoChanged

      好友信息变更回调。

      当客户端本端或其他端同步更新好友信息时会触发该回调。

      参数名称 类型 是否必填 是否只读 说明
      friendInfo NIMFriend 变更的好友信息

    系统通知相关监听器

    dartStream<List<NIMCustomNotification>> get onReceiveCustomNotifications =>
        _platform.onReceiveCustomNotifications;
    Stream<List<NIMBroadcastNotification>> get onReceiveBroadcastNotifications =>
        _platform.onReceiveBroadcastNotifications;
    

    成员函数

    • onReceiveCustomNotifications

      自定义通知接收回调,本端接收到发送方自定义通知,或其他端同步的自定义通知时会触发该回调。

      参数名称 类型 说明
      customNotifications List<NIMCustomNotification> 自定义通知列表
    • onReceiveBroadcastNotifications

      广播通知接收回调。

      本端接收到服务端下发的广播通知时会触发该回调。

      参数名称 类型 说明
      boradcastNotifications List<NIMBroadcastNotification> 广播通知列表

    群组相关监听器

    dartStream<void> get onSyncStarted => _platform.onSyncStarted.stream;
    Stream<void> get onSyncFinished => _platform.onSyncFinished.stream;
    Stream<void> get onSyncFailed => _platform.onSyncFailed.stream;
    Stream<NIMTeam> get onTeamCreated => _platform.onTeamCreated.stream;
    Stream<NIMTeam> get onTeamDismissed => _platform.onTeamDismissed.stream;
    Stream<NIMTeam> get onTeamJoined => _platform.onTeamJoined.stream;
    Stream<TeamLeftReuslt> get onTeamLeft => _platform.onTeamLeft.stream;
    Stream<NIMTeam> get onTeamInfoUpdated => _platform.onTeamInfoUpdated.stream;
    Stream<List<NIMTeamMember>> get onTeamMemberJoined =>
        _platform.onTeamMemberJoined.stream;
    Stream<TeamMemberKickedResult> get onTeamMemberKicked =>
        _platform.onTeamMemberKicked.stream;
    Stream<List<NIMTeamMember>> get onTeamMemberLeft =>
        _platform.onTeamMemberLeft.stream;
    Stream<List<NIMTeamMember>> get onTeamMemberInfoUpdated =>
        _platform.onTeamMemberInfoUpdated.stream;
    Stream<NIMTeamJoinActionInfo> get onReceiveTeamJoinActionInfo =>
        _platform.onReceiveTeamJoinActionInfo.stream;
    

    成员函数

    • onSyncStarted

      群组数据同步开始回调。

    • onSyncFinished

      群组数据同步结束回调。

      请在收到该回调之后进行群组相关操作,否则可能导致数据不完整。

    • onSyncFailed

      群组数据同步失败回调。

      如果在收到该回调之后进行群组相关操作,群组数据可能不完整。相关错误恢复后,会逐步按需重建数据。

      参数名称 类型 说明
      error NIMError 群组数据同步失败错误码及错误信息
    • onTeamCreated

      群组成功创建回调。
      当本地端或多端同步创建群组成功时会触发该回调。

      参数名称 类型 说明
      team NIMTeam 创建的群组对象
    • onTeamDismissed

      群组解散回调。
      当本地端或多端同步解散群组成功时会触发该回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      team NIMTeam 解散的群组对象
    • onTeamJoined

      加入群组回调。
      当本地端或多端同步加入群组时会触发该回调。

      参数名称 类型 说明
      team NIMTeam 加入的群组对象
    • onTeamLeft

      离开群组回调。
      当本地端或多端主动离开群组或被踢出群组时会触发该回调。

      参数名称 类型 说明
      team NIMTeam 离开的群组对象
    • onTeamInfoUpdated

      群组信息更新回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      team NIMTeam 更新后的群组对象
    • onTeamMemberJoined

      成员加入群组回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      teamMembers List<NIMTeamMember> 加入群的群组成员列表
    • onTeamMemberKicked

      群成员被踢出群组回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      operatorAccountId String 操作者账号
      teamMembers List<NIMTeamMember> 被踢出的群组成员列表
    • onTeamMemberLeft

      群成员离开群组回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      teamMembers List<NIMTeamMember> 离开群组的成员列表
    • onTeamMemberInfoUpdated

      群成员信息变更回调。群组内所有成员均会收到该回调。

      参数名称 类型 说明
      teamMembers List<NIMTeamMember> 变更后的群成员列表
    • onReceiveTeamJoinActionInfo

      收到入群操作信息回调。包含以下场景:

      • 群主或管理员收到入群申请回调,回调类型:joinActionTypeApplication 管理员后续操作: - acceptJoinApplication:接受成员的入群申请,成员入群 - rejectJoinApplication:拒绝成员的入群申请,申请方收到对应回调
      • 申请人收到入群申请被群主或管理员拒绝回调,回调类型:joinActionTypeRejectInvitation
      • 收到入群邀请回调,回调类型:joinActionTypeInvitation 成员后续操作: - acceptInvitation:接受邀请入群,调用后进入群组 - rejectInvitation:拒绝接受邀请,管理员收到对应回调
      • 收到入群邀请被拒绝回调,回调类型:joinActionTypeRejectApplication
      参数名称 类型 说明
      joinActionInfo NIMTeamJoinActionInfo 入群操作信息

    系统设置相关监听器

    dartStream<TeamMuteModeChangedResult> get onTeamMessageMuteModeChanged =>
        _platform.onTeamMessageMuteModeChanged.stream;
    Stream<P2PMuteModeChangedResult> get onP2PMessageMuteModeChanged =>
        _platform.onP2PMessageMuteModeChanged.stream;
    StreamController<bool> onPushMobileOnDesktopOnline =
        StreamController.broadcast();
    

    成员函数

    • onTeamMessageMuteModeChanged

      群组消息免打扰模式变更回调。

      参数名称 类型 说明
      teamId String 群组 ID
      teamType NIMTeamType 群组类型,包括高级群和超大群。
      muteMode NIMTeamMessageMuteMode 群消息免打扰模式:免打扰开启或免打扰关闭
    • onP2PMessageMuteModeChanged

      单聊(点对点)消息免打扰模式变更回调。

      参数名称 类型 说明
      accountId String 聊天对象用户账号
      muteMode NIMP2PMessageMuteMode 单聊消息免打扰模式:免打扰开启或免打扰关闭
    • onPushMobileOnDesktopOnline

      设置当桌面端在线时,移动端是否需要推送的在线回调。

      参数名称 类型 说明
      need bool 桌面端在线时,移动端是否需要推送。true 表示需要推送,false 表示不需要

    存储服务相关监听器

    dartStream<NIMDownloadFileProgress> get onFileDownloadProgress =>
        _platform.onFileDownloadProgress;
    Stream<NIMUploadFileProgress> get onFileUploadProgress =>
        _platform.onFileUploadProgress;
    Stream<NIMDownloadMessageAttachmentProgress>
        get onMessageAttachmentDownloadProgress =>
            _platform.onMessageAttachmentDownloadProgress;    
    

    成员函数

    • onFileDownloadProgress

      文件下载进度回调,返回文件的下载进度。

      参数名称 类型 说明
      url String 文件下载地址。
      progress int 文件下载进度。
    • onFileUploadProgress

      文件上传进度回调,返回文件的上传进度。

      参数名称 类型 说明
      taskId String 文件任务 ID。
      progress int 文件上传进度。
    • onMessageAttachmentDownloadProgress

      消息附件下载进度回调,返回消息附件的下载进度。

      参数名称 类型 说明
      downloadParam NIMDownloadMessageAttachmentParams 文件下载配置参数。
      progress int 文件下载进度。

    用户订阅相关监听器

    DartStream<List<NIMUserStatus>> get onUserStatusChanged;
    

    成员函数

    • onUserStatusChanged

      其他用户的用户状态变更回调,包括在线状态和自定义状态。同账号发布状态时,多端也会同步收到回调。

      在线状态事件会受到推送的影响:
      如果应用被清理,但厂商推送(APNS、小米、华为、OPPO、VIVO、魅族、FCM)可达,则默认不会触发该用户断开连接的事件;若开发者需要该种情况下视为离线,请 前往网易云信控制台>选择应用>IM 即时通讯>功能配置>全局功能>在线状态订阅 进行设置。

      参数名称 类型 说明
      userStatusList List<NIMUserStatus> 用户状态列表

    聊天室实例相关监听器

    dartStream<void> get onChatroomEntered => _onChatroomEnteredController.stream;
    Stream<NIMError?> get onChatroomExited => _onChatroomExitedController.stream;
    Stream<V2NIMChatroomKickedInfo> get onChatroomKicked =>
        _onChatroomKickedController.stream;
    Stream<V2NIMChatroomStatusInfo> get onChatroomStatus =>
        _onChatroomStatusController.stream;   
    

    成员函数

    • onChatroomEntered

      进入聊天室回调。

    • onChatroomExited

      退出聊天室回调。退出聊天室后,不会继续重连。退出聊天室包括以下场景:

      • 账号变更后登录失败导致退出聊天室。
      • 被加入聊天室黑名单导致退出聊天室。
      • 由于账号被封禁导致退出聊天室。
      • 由于聊天室被关闭导致退出聊天室。
      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      error NIMError 错误信息。
    • onChatroomKicked

      被踢出聊天室回调。被踢出聊天室后,会同时触发 onChatroomExited 回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      kickedInfo V2NIMChatroomKickedInfo 被踢详细信息。
    • onChatroomStatus

      聊天室状态变更回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      status V2NIMChatroomStatus 聊天室状态信息。
      error NIMError 错误信息。

    聊天室相关监听器

    dartStream<ChatroomSendMessageEvent> get onSendMessage =>
        _onSendMessageController.stream;
    Stream<ChatroomReceiveMessagesEvent> get onReceiveMessages =>
        _onReceiveMessagesController.stream;
    Stream<NIMSendMessageProgress> get onSendMessageProgress =>
        ChatroomServicePlatform.instance.onSendMessageProgress.stream;
    Stream<ChatroomInfoUpdatedEvent> get onChatroomInfoUpdated =>
        _onChatroomInfoUpdatedController.stream;
    Stream<ChatroomMemberEnterEvent> get onChatroomMemberEnter =>
        _onChatroomMemberEnterController.stream;
    Stream<ChatroomMemberExitEvent> get onChatroomMemberExit =>
        _onChatroomMemberExitController.stream;
    Stream<ChatroomMemberRoleUpdatedEvent> get onChatroomMemberRoleUpdated =>
        _onChatroomMemberRoleUpdatedController.stream;
    Stream<ChatroomMemberInfoUpdatedEvent> get onChatroomMemberInfoUpdated =>
        _onChatroomMemberInfoUpdatedController.stream;
    Stream<SelfChatBannedUpdatedEvent> get onSelfChatBannedUpdated =>
        _onSelfChatBannedUpdatedController.stream;
    Stream<SelfTempChatBannedUpdatedEvent> get onSelfTempChatBannedUpdated =>
        _onSelfTempChatBannedUpdatedController.stream;
    Stream<ChatroomChatBannedUpdatedEvent> get onChatroomChatBannedUpdated =>
        _onChatroomChatBannedUpdatedController.stream;
    Stream<ChatroomMessageRevokedNotificationEvent>
        get onMessageRevokedNotification =>
            _onMessageRevokedNotificationController.stream;
    Stream<ChatroomTagsUpdatedEvent> get onChatroomTagsUpdated =>
        _onChatroomTagsUpdatedController.stream;
    

    成员函数

    • onSendMessage

      本端发送聊天室消息状态回调,本端发送聊天室消息或插入聊天室消息成功后,SDK 会返回该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      message V2NIMChatroomMessage 发送或插入的聊天室消息。
    • onReceiveMessages

      聊天室消息接收回调,本端接收到消息,或其他端同步的消息时会触发该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      messages List<V2NIMChatroomMessage> 接收的聊天室消息列表。
    • onSendMessageProgress

      聊天室发送消息进度回调,本端发送消息后,SDK 会返回消息的发送进度回调。

      参数名称 类型 说明
      messageClientId String 消息的客户端 ID。
      progress int 消息发送进度。
    • onChatroomInfoUpdated

      聊天室资料信息更新回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      info V2NIMChatroomInfo 更新后的聊天室信息。
    • onChatroomMemberEnter

      成员进入聊天室回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      member V2NIMChatroomMember 进入的聊天室成员信息。
    • onChatroomMemberExit

      成员退出聊天室回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      accountId String 退出的聊天室成员用户账号 ID。
    • onChatroomMemberRoleUpdated

      聊天室成员角色类型变更回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      previousRole V2NIMChatroomMemberRole 变更前的角色类型信息。
      member V2NIMChatroomMember 角色变更的聊天室成员信息。
    • onChatroomMemberInfoUpdated

      聊天室成员信息变更回调。聊天室内所有成员均会收到该回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      member V2NIMChatroomMember 信息变更的聊天室成员信息。
    • onSelfChatBannedUpdated

      聊天室成员本人禁言状态变更回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      chatBanned bool 是否处于禁言状态。
    • onSelfTempChatBannedUpdated

      聊天室成员本人临时禁言状态变更回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      tempChatBanned bool 是否处于临时禁言状态。
      tempChatBannedDuration int 临时禁言时长(秒)。
    • onChatroomChatBannedUpdated

      聊天室整体禁言状态变更回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      chatBanned bool 是否处于整体禁言状态。
    • onMessageRevokedNotification

      聊天室消息撤回回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      messageClientId String 被撤回消息的客户端 ID。
      messageTime int 被撤回消息的时间戳。
    • onChatroomTagsUpdated

      聊天室标签信息变更回调。

      参数名称 类型 说明
      instanceId int 聊天室实例 ID。
      tags List<String> 更新后的标签信息。

    聊天室队列相关监听器

    dartStream<V2NIMChatroomQueueElement> get onChatroomQueueOffered =>
        _onChatroomQueueOfferedController.stream;
    Stream<V2NIMChatroomQueueElement> get onChatroomQueuePolled =>
        _onChatroomQueuePolledController.stream;
    Stream<void> get onChatroomQueueDropped =>
        _onChatroomQueueDroppedController.stream;
    Stream<List<V2NIMChatroomQueueElement>> get onChatroomQueuePartCleared =>
        _onChatroomQueuePartClearedController.stream;
    Stream<List<V2NIMChatroomQueueElement>> get onChatroomQueueBatchUpdated =>
        _onChatroomQueueBatchUpdatedController.stream;
    Stream<List<V2NIMChatroomQueueElement>> get onChatroomQueueBatchOffered =>
        _onChatroomQueueBatchOfferedController.stream;
    

    成员函数

    • onChatroomQueueOffered

      聊天室新增队列元素回调。在聊天室队列中新增元素成功后,SDK 会返回该回调。

      参数名称 类型 说明
      element V2NIMChatroomQueueElement 新增的队列元素。
    • onChatroomQueuePolled

      聊天室取出(移除)队列元素回调。在聊天室队列中取出(移除)元素会触发该回调。

      参数名称 类型 说明
      element V2NIMChatroomQueueElement 取出的队列元素。
    • onChatroomQueueDropped

      聊天室清空队列元素回调。聊天室队列中的元素被清空会触发该回调。

    • onChatroomQueuePartCleared

      聊天室清理部分队列元素回调。聊天室队列中的部分元素被清理时会触发该回调。

      参数名称 类型 说明
      elements List<V2NIMChatroomQueueElement> 被清理的队列元素列表。
    • onChatroomQueueBatchUpdated

      聊天室批量更新队列元素回调。当聊天室队列中的元素被批量更新时会触发该回调。

      参数名称 类型 说明
      elements List<V2NIMChatroomQueueElement> 被批量更新的队列元素列表。
    • onChatroomQueueBatchOffered

      聊天室批量添加队列元素回调。当聊天室队列中批量添加元素时会触发该回调。

      参数名称 类型 说明
      elements List<V2NIMChatroomQueueElement> 被批量添加的队列元素列表。
    此文档是否对你有帮助?
    有帮助
    去反馈
    • NIMResult
    • NIMError
    • NIMLoginOption
    • NIMLoginClient
    • NIMKickedOfflineDetail
    • NIMDataSyncDetail
    • NIMLoginClientChangeEvent
    • NIMConversationOption
    • NIMConversationResult
    • NIMConversation
    • NIMConversationFilter
    • NIMConversationOperationResult
    • NIMConversationUpdate
    • ConversationIdUtil
    • NIMMessage
    • NIMMessageFilter
    • NIMMessageStatus
    • NIMMessageConfig
    • NIMMessagePushConfig
    • NIMMessageRouteConfig
    • NIMMessageAntispamConfig
    • NIMMessageRobotConfig
    • NIMLastMessage
    • NIMMessageQuickComment
    • NIMMessageQuickCommentPushConfig
    • NIMMessagePin
    • NIMCollection
    • NIMAddCollectionParams
    • NIMCollectionOption
    • NIMCollectionListResult
    • NIMSendMessageParams
    • NIMMessageTargetConfig
    • NIMModifyMessageParams
    • NIMModifyMessageResult
    • NIMUpdateLocalMessageParams
    • NIMMessageRefer
    • NIMMessageAttachment
    • NIMDownloadMessageAttachmentParams
    • NIMGetMediaResourceInfoResult
    • NIMSize
    • NIMMessageFileAttachment
    • NIMMessageImageAttachment
    • NIMMessageAudioAttachment
    • NIMMessageVideoAttachment
    • NIMMessageCallAttachment
    • NIMMessageCallDuration
    • NIMMessageLocationAttachment
    • NIMMessageNotificationAttachment
    • NIMSendMessageResult
    • NIMMessageListOption
    • NIMMessageListResult
    • NIMThreadMessageListOption
    • NIMThreadMessageListResult
    • NIMP2PMessageReadReceipt
    • NIMTeamMessageReadReceipt
    • NIMTeamMessageReadReceiptDetail
    • NIMMessageRevokeParams
    • NIMMessageRevokeNotification
    • NIMMessageDeletedNotification
    • NIMMessageQuickCommentNotification
    • NIMMessagePinNotification
    • NIMClearHistoryMessageOption
    • NIMClearHistoryNotification
    • NIMSendMessageProgress
    • NIMMessageSearchParams
    • NIMMessageSearchExParams
    • NIMMessageSearchResult
    • NIMMessageSearchItem
    • NIMClientAntispamResult
    • NIMVoiceToTextParams
    • NIMStorageScene
    • NIMCustomNotification
    • NIMNotificationConfig
    • NIMNotificationPushConfig
    • NIMNotificationRouteConfig
    • NIMNotificationAntispamConfig
    • NIMSendCustomNotificationParams
    • NIMBroadcastNotification
    • NIMTeam
    • NIMTeamMember
    • NIMCreateTeamParams
    • NIMTeamMemberQueryOption
    • NIMUpdateTeamInfoParams
    • NIMCreateTeamResult
    • NIMTeamInviteParams
    • NIMUpdateSelfMemberInfoParams
    • NIMTeamMemberListResult
    • NIMTeamJoinActionInfo
    • NIMTeamJoinActionInfoQueryOption
    • NIMTeamJoinActionInfoResult
    • NIMTeamMemberSearchOption
    • NIMTeamMemberSearchResult
    • NIMDndConfig
    • NIMUserInfo
    • NIMAIUser
    • NIMAIModelConfig
    • NIMProxyAIModelCallParams
    • NIMProxyAICallAntispamConfig
    • NIMAIModelCallContent
    • NIMAIModelCallMessage
    • NIMAIModelConfigParams
    • NIMMessageAIConfigParams
    • NIMAIModelCallResult
    • NIMMessageAIConfig
    • NIMAIRAGInfo
    • NIMMessageAIStreamChunk
    • NIMMessageAIStreamStopParams
    • NIMMessageAIRegenParams
    • NIMAIModelStreamCallChunk
    • NIMAIModelStreamCallContent
    • NIMAIModelStreamCallResult
    • NIMAIModelStreamCallStopParams
    • NIMUserUpdateParam
    • NIMUserSearchOption
    • NIMFriend
    • NIMFriendAddParams
    • NIMFriendAddApplication
    • NIMFriendDeleteParams
    • NIMFriendSetParams
    • NIMFriendAddApplicationQueryOption
    • NIMFriendAddApplicationResult
    • NIMFriendSearchOption
    • V2NIMUserInfoConfig
    • NIMUploadFileTask
    • NIMUploadFileParams
    • NIMAntispamConfig
    • NIMSDKOption(仅 iOS)
    • NIMPCSDKOptions(仅 macOS/Windows)
    • NIMUpdatedTeamInfo
    • NIMDownloadFileProgress
    • NIMUploadFileProgress
    • NIMDownloadMessageAttachmentProgress
    • NIMSubscribeUserStatusOption
    • NIMUserStatus
    • NIMUnsubscribeUserStatusOption
    • NIMCustomUserStatusParams
    • NIMUserStatusSubscribeResult
    • NIMCustomUserStatusPublishResult
    • NIMStatusBarNotificationConfig
    • V2NIMChatroomClient
    • V2NIMChatroomEnterParams
    • V2NIMChatroomTagConfig
    • V2NIMChatroomEnterResult
    • V2NIMChatroomInfo
    • V2NIMChatroomMessage
    • V2NIMChatroomMessageConfig
    • V2NIMLocationInfo
    • V2NIMChatroomKickedInfo
    • V2NIMChatroomMember
    • V2NIMChatroomEnterInfo
    • V2NIMSendChatroomMessageParams
    • V2NIMSendChatroomMessageResult
    • V2NIMChatroomMessageListOption
    • V2NIMChatroomTagMessageOption
    • V2NIMChatroomMemberQueryOption
    • V2NIMChatroomMemberListResult
    • V2NIMChatroomTagMemberOption
    • V2NIMChatroomMemberRoleUpdateParams
    • V2NIMChatroomTagTempChatBannedParams
    • V2NIMChatroomSelfMemberUpdateParams
    • V2NIMChatroomUpdateParams
    • V2NIMChatroomLocationConfig
    • V2NIMChatroomTagsUpdateParams
    • V2NIMConversationGroup
    • V2NIMConversationGroupResult
    • V2NIMConversationOperationResult
    • V2NIMChatroomQueueOfferParams
    • V2NIMChatroomQueueElement
    • V2NIMChatroomNotificationAttachment
    • V2NIMChatroomMessageRevokeNotificationAttachment
    • V2NIMChatroomChatBannedNotificationAttachment
    • V2NIMChatroomMemberEnterNotificationAttachment
    • V2NIMChatroomMemberRoleUpdateAttachment
    • V2NIMChatroomQueueNotificationAttachment
    • 枚举
    • NIMAIModelType
    • NIMAIModelRoleType
    • NIMMessageAIStatus
    • NIMLoginStatus
    • NIMLoginAuthType
    • NIMDataSyncLevel
    • NIMLoginClientType
    • NIMLoginClientChange
    • NIMKickedOfflineReason
    • NIMConnectStatus
    • NIMDataSyncType
    • NIMDataSyncState
    • NIMConversationType
    • NIMLastMessageState
    • NIMMessageType
    • NIMMessageAttachmentUploadState
    • NIMMessageNotificationType
    • NIMMessageSendingState
    • NIMClientAntispamOperateType
    • NIMQueryDirection
    • NIMMessageRevokeType
    • NIMMessagePinState
    • NIMMessageQuickCommentType
    • NIMSortOrder
    • NIMTeamType
    • NIMTeamJoinMode
    • NIMTeamAgreeMode
    • NIMTeamInviteMode
    • NIMTeamUpdateInfoMode
    • NIMTeamChatBannedMode
    • NIMTeamUpdateExtensionMode
    • NIMTeamMemberRole
    • NIMTeamMemberRoleQueryType
    • NIMTeamJoinActionType
    • NIMTeamJoinActionStatus
    • NIMP2PMessageMuteMode
    • NIMTeamMessageMuteMode
    • NIMFriendAddMode
    • NIMFriendAddApplicationStatus
    • NIMFriendDeletionType
    • NIMDownloadAttachmentType
    • NIMClientType
    • NIMNotificationFoldStyle
    • NIMNotificationExtraType
    • V2NIMChatroomQueueLevelMode
    • V2NIMChatroomKickedReason
    • V2NIMChatroomStatus
    • V2NIMChatroomMemberRole
    • V2NIMMessageQueryDirection
    • V2NIMChatroomQueueChangeType
    • V2NIMChatroomMessageNotificationType
    • NIMSearchKeywordMatchType
    • NIMClearHistoryMode
    • V2NIMMessageAIStreamStatus
    • V2NIMMessageAIStreamStopOpType
    • V2NIMMessageAIRegenOpType
    • V2NIMAIModelStreamCallStatus
    • NIMSearchDirection
    • NIMSearchStrategy
    • 监听
    • 登录相关监听器
    • 会话相关监听器
    • 会话分组相关监听器
    • 消息相关监听器
    • AI 透传相关监听器
    • 用户资料相关监听器
    • 好友信息相关监听器
    • 系统通知相关监听器
    • 群组相关监听器
    • 系统设置相关监听器
    • 存储服务相关监听器
    • 用户订阅相关监听器
    • 聊天室实例相关监听器
    • 聊天室相关监听器
    • 聊天室队列相关监听器